import Timezone from "../../Types/Timezone";
import OneUptimeDate from "../../Types/Date";
export default class TimezoneUtil {
    static getTimezoneDropdownOptions() {
        let timezoneOptions = Object.keys(Timezone);
        // order timezone by GMT offset.
        timezoneOptions = timezoneOptions.sort((a, b) => {
            const keyOfTimezoneA = a;
            const keyOfTimezoneB = b;
            return (OneUptimeDate.getGmtOffsetByTimezone(Timezone[keyOfTimezoneA]) -
                OneUptimeDate.getGmtOffsetByTimezone(Timezone[keyOfTimezoneB]));
        });
        return timezoneOptions.map((key) => {
            const keyOfTimezone = key;
            const value = Timezone && Timezone[keyOfTimezone]
                ? Timezone[keyOfTimezone].toString()
                : "";
            return {
                value: value,
                label: OneUptimeDate.getGmtOffsetFriendlyStringByTimezone(Timezone[keyOfTimezone]),
            };
        });
    }
}
//# sourceMappingURL=Timezone.js.map