at the end of the day, it was inevitable

This commit is contained in:
Mo Elzubeir
2022-12-09 08:36:26 -06:00
commit 1218570914
1768 changed files with 887087 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import moment from 'moment-timezone'
const getZonesNames = function () {
return moment.tz.names()
}
export const getCurrentTimezone = function () {
return moment.tz.guess()
}
const getTimezones = function () {
const names = getZonesNames()
return names.map(name => {
const zone = moment.tz.zone(name)
const utc = moment.parseZone(zone).format('Z')
const label = `(UTC ${utc}) ${name}`
return {value: name, label}
})
}
export const timezones = getTimezones()