move cronDays, cronHours to utils
This commit is contained in:
+20
-2
@@ -619,6 +619,20 @@ function getDataURLFromFile(file) {
|
||||
});
|
||||
}
|
||||
|
||||
// values correspond to cron days
|
||||
const cronDays = [
|
||||
{ id: 0, name: 'Sunday' },
|
||||
{ id: 1, name: 'Monday' },
|
||||
{ id: 2, name: 'Tuesday' },
|
||||
{ id: 3, name: 'Wednesday' },
|
||||
{ id: 4, name: 'Thursday' },
|
||||
{ id: 5, name: 'Friday' },
|
||||
{ id: 6, name: 'Saturday' },
|
||||
];
|
||||
|
||||
// generates 24h time sets (instead of american 12h) to avoid having to translate everything to locales eg. 12:00
|
||||
const cronHours = Array.from({ length: 24 }).map(function (v, i) { return { id: i, name: (i < 10 ? '0' : '') + i + ':00' }; });
|
||||
|
||||
// named exports
|
||||
export {
|
||||
download,
|
||||
@@ -630,7 +644,9 @@ export {
|
||||
taskNameFromInstallationState,
|
||||
redirectIfNeeded,
|
||||
stripSsoInfo,
|
||||
getDataURLFromFile
|
||||
getDataURLFromFile,
|
||||
cronDays,
|
||||
cronHours
|
||||
};
|
||||
|
||||
// default export
|
||||
@@ -644,5 +660,7 @@ export default {
|
||||
taskNameFromInstallationState,
|
||||
redirectIfNeeded,
|
||||
stripSsoInfo,
|
||||
getDataURLFromFile
|
||||
getDataURLFromFile,
|
||||
cronDays,
|
||||
cronHours
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user