/*\r
- * This file is part of NeverNote \r
+ * This file is part of NixNote \r
* Copyright 2009,2010 Randy Baumgarte\r
* Copyright 2010 Hiroshi Miura\r
* \r
\r
package cx.fbn.nevernote.filters;\r
\r
+import com.evernote.edam.type.Note;\r
import com.trolltech.qt.core.QCoreApplication;\r
import com.trolltech.qt.core.QDateTime;\r
-import com.evernote.edam.type.Note;\r
-\r
-import cx.fbn.nevernote.filters.DateAttributeFilter;\r
\r
public class DateAttributeFilterFactory {\r
private DateAttributeFilterFactory () {};\r
super(since, created);\r
}\r
// Check if it was within the last day\r
+ @Override\r
public boolean attributeCheck(Note n) {\r
QDateTime noteDate, current;\r
noteDate = noteTime(n);\r
else \r
return noteDate.daysTo(current) > 0;\r
}\r
+ @Override\r
public String getLabel(){\r
return QCoreApplication.translate("cx.fbn.nevernote.filters.DateAttributeFilter", "Today");\r
}\r
}\r
\r
// Check if it was within the last two days\r
- public boolean attributeCheck(Note n) {\r
+ @Override\r
+ public boolean attributeCheck(Note n) {\r
QDateTime noteDate, current;\r
noteDate = noteTime(n);\r
current = currentTime();\r
else\r
return noteDate.daysTo(current) > 1;\r
}\r
+ @Override\r
public String getLabel(){\r
return QCoreApplication.translate("cx.fbn.nevernote.filters.DateAttributeFilter", "Yesterday");\r
}\r
}\r
\r
// Check if it was within the last two days\r
- public boolean attributeCheck(Note n) {\r
+ @Override\r
+ public boolean attributeCheck(Note n) {\r
QDateTime noteDate, current;\r
noteDate = noteTime(n);\r
current = currentTime();\r
else\r
return noteDate.daysTo(current) > 7;\r
}\r
+ @Override\r
public String getLabel(){\r
return QCoreApplication.translate("cx.fbn.nevernote.filters.DateAttributeFilter", "This Week");\r
}\r
}\r
\r
// Check if it was within the last two weeks\r
- public boolean attributeCheck(Note n) {\r
+ @Override\r
+ public boolean attributeCheck(Note n) {\r
QDateTime noteDate, current;\r
noteDate = noteTime(n);\r
current = currentTime();\r
else\r
return noteDate.daysTo(current) > 14;\r
}\r
+ @Override\r
public String getLabel(){\r
return QCoreApplication.translate("cx.fbn.nevernote.filters.DateAttributeFilter", "Last Week");\r
}\r
}\r
\r
// Check if it was within the last month\r
- public boolean attributeCheck(Note n) {\r
+ @Override\r
+ public boolean attributeCheck(Note n) {\r
QDateTime noteDate, current;\r
noteDate = noteTime(n);\r
current = currentTime();\r
return noteDate.date().month() - current.date().month() != 0;\r
}\r
}\r
+ @Override\r
public String getLabel(){\r
return QCoreApplication.translate("cx.fbn.nevernote.filters.DateAttributeFilter", "This Month");\r
}\r
}\r
\r
// Check if it was within the last two months\r
- public boolean attributeCheck(Note n) {\r
+ @Override\r
+ public boolean attributeCheck(Note n) {\r
QDateTime noteDate, current;\r
noteDate = noteTime(n);\r
current = currentTime();\r
return cm-nm > 1;\r
}\r
}\r
+ @Override\r
public String getLabel(){\r
return QCoreApplication.translate("cx.fbn.nevernote.filters.DateAttributeFilter", "Last Month");\r
}\r
super(since,created);\r
}\r
// Check if it was within this year\r
- public boolean attributeCheck(Note n) {\r
+ @Override\r
+ public boolean attributeCheck(Note n) {\r
QDateTime noteDate, current;\r
noteDate = noteTime(n);\r
current = currentTime();\r
return cy-ny > 0;\r
} \r
\r
+ @Override\r
public String getLabel(){\r
return QCoreApplication.translate("cx.fbn.nevernote.filters.DateAttributeFilter", "This Year");\r
}\r
}\r
\r
// Check if it was within the last year\r
- public boolean attributeCheck(Note n) {\r
+ @Override\r
+ public boolean attributeCheck(Note n) {\r
QDateTime noteDate, current;\r
noteDate = noteTime(n);\r
current = currentTime();\r
return cy-ny > 1;\r
}\r
\r
+ @Override\r
public String getLabel(){\r
return QCoreApplication.translate("cx.fbn.nevernote.filters.DateAttributeFilter", "Last Year");\r
}\r