diff --git a/migrations/1645459054117-default-timezone.js b/migrations/1645459054117-default-timezone.js new file mode 100644 index 00000000..d2e64fb0 --- /dev/null +++ b/migrations/1645459054117-default-timezone.js @@ -0,0 +1,20 @@ +const _ = require('lodash/fp') +const { saveConfig, loadLatest } = require('../lib/new-settings-loader') + +exports.up = function (next) { + const newConfig = {} + return loadLatest() + .then(config => { + if (!_.isNil(config.config.locale_timezone)) return + newConfig[`locale_timezone`] = 'GMT' + return saveConfig(newConfig) + }) + .then(next) + .catch(err => { + return next(err) + }) +} + +module.exports.down = function (next) { + next() +} diff --git a/new-lamassu-admin/src/utils/timezone-list.js b/new-lamassu-admin/src/utils/timezone-list.js index 8683cfcd..f7984f7d 100644 --- a/new-lamassu-admin/src/utils/timezone-list.js +++ b/new-lamassu-admin/src/utils/timezone-list.js @@ -143,4 +143,6 @@ const buildTzLabels = timezoneList => { const labels = buildTzLabels(timezones) -export { labels, timezones } +const DEFAULT_TIMEZONE = 'GMT' + +export { labels, timezones, DEFAULT_TIMEZONE }