move cronDays, cronHours to utils

This commit is contained in:
Girish Ramakrishnan
2025-10-07 14:37:53 +02:00
parent 491617e41c
commit 1a674a30ac
4 changed files with 27 additions and 36 deletions
+20 -2
View File
@@ -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
};