A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix: export getLastWeekTimestamp
thecodrrcb5f6ade62d0
diff --git a/packages/core/utils/date.js b/packages/core/utils/date.jsindex 377a5e31d..540be9d0c 100644--- a/packages/core/utils/date.js+++ b/packages/core/utils/date.js@@ -26,13 +26,13 @@ function getWeeksInYear(year) {return weeks;}-function getDayTimestamp(last) {+/* function getDayTimestamp(last) {to = new Date().getDate() - last;date = new Date();return date.setDate(to);-}+} */-function getLastWeekTimestamp() {+export function getLastWeekTimestamp() {const t = new Date().getDate() + (6 - new Date().getDay() - 1) - 6;const lastSaturday = new Date();return lastSaturday.setDate(t);@@ -56,7 +56,7 @@ export function getWeekGroupFromTimestamp(timestamp) {let date = new Date(timestamp);if (!years.hasOwnProperty(date.getFullYear())) {- years[date.getFullYear()] = weeks;+ years[date.getFullYear()] = getWeeksInYear(date.getFullYear());}let weeks = years[date.getFullYear()];