refactor api.startOfWeek to a cron.js function not exposed on api

This commit is contained in:
Alys
2015-11-21 22:26:05 +10:00
parent e0784a9791
commit 6183fd9e71
4 changed files with 17 additions and 12 deletions

View File

@@ -37,3 +37,13 @@ export function sanitizeOptions (o) {
now,
};
}
export function startOfWeek (options) {
if (options === null) {
options = {};
}
let o = sanitizeOptions(options);
return moment(o.now).startOf('week');
}