fix: return created groups

This commit is contained in:
thecodrr
2019-12-12 11:49:40 +05:00
parent 52caba7eed
commit 368bd9324f

View File

@@ -63,9 +63,11 @@ class Database {
note => months[new Date(note.dateCreated).getMonth()] note => months[new Date(note.dateCreated).getMonth()]
); );
case "week": case "week":
groupBy(notes, note => getWeekGroupFromTimestamp(note.dateCreated)); return groupBy(notes, note =>
getWeekGroupFromTimestamp(note.dateCreated)
);
case "year": case "year":
groupBy( return groupBy(
notes, notes,
note => months[new Date(note.dateCreated).getFullYear()] note => months[new Date(note.dateCreated).getFullYear()]
); );
@@ -74,7 +76,7 @@ class Database {
recent: getLastWeekTimestamp(7), recent: getLastWeekTimestamp(7),
lastWeek: getLastWeekTimestamp(7) - 604800000 //seven day timestamp value lastWeek: getLastWeekTimestamp(7) - 604800000 //seven day timestamp value
}; };
groupBy(notes, note => return groupBy(notes, note =>
note.dateCreated >= timestamps.recent note.dateCreated >= timestamps.recent
? "Recent" ? "Recent"
: note.dateCreated >= timestamps.lastWeek : note.dateCreated >= timestamps.lastWeek