// helper to map windows time zone to oslo windows times.
var timezone = {};

/*
Microsoft Graph returns the time zones in Windows time.
Need to convert.
*/
var windowsTimesToOlsonMappings = {
    'W. Central Africa Standard Time': 'Africa/Bangui',
    'Egypt Standard Time': 'Africa/Cairo',
    'Morocco Standard Time': 'Africa/Casablanca',
    'South Africa Standard Time': 'Africa/Harare',
    'South Africa Standard Time': 'Africa/Johannesburg',
    'W. Central Africa Standard Time': 'Africa/Lagos',
    'Greenwich Standard Time': 'Africa/Monrovia',
    'E. Africa Standard Time': 'Africa/Nairobi',
    'Namibia Standard Time': 'Africa/Windhoek',
    'Alaskan Standard Time': 'America/Anchorage',
    'Argentina Standard Time': 'America/Argentina/San_Juan',
    'Paraguay Standard Time': 'America/Asuncion',
    'Bahia Standard Time': 'America/Bahia',
    'SA Pacific Standard Time': 'America/Bogota',
    'Argentina Standard Time': 'America/Buenos_Aires',
    'Venezuela Standard Time': 'America/Caracas',
    'SA Eastern Standard Time': 'America/Cayenne',
    'Central Standard Time': 'America/Chicago',
    'Mountain Standard Time (Mexico)': 'America/Chihuahua',
    'Central Brazilian Standard Time': 'America/Cuiaba',
    'Mountain Standard Time': 'America/Denver',
    'SA Eastern Standard Time': 'America/Fortaleza',
    'Greenland Standard Time': 'America/Godthab',
    'Central America Standard Time': 'America/Guatemala',
    'Atlantic Standard Time': 'America/Halifax',
    'US Eastern Standard Time': 'America/Indianapolis',
    'US Eastern Standard Time': 'America/Indiana/Indianapolis',
    'SA Western Standard Time': 'America/La_Paz',
    'Pacific Standard Time': 'America/Los_Angeles',
    'Mexico Standard Time': 'America/Mexico_City',
    'Montevideo Standard Time': 'America/Montevideo',
    'Eastern Standard Time': 'America/New_York',
    'UTC-02': 'America/Noronha',
    'US Mountain Standard Time': 'America/Phoenix',
    'Canada Central Standard Time': 'America/Regina',
    'Pacific Standard Time (Mexico)': 'America/Santa_Isabel',
    'Pacific SA Standard Time': 'America/Santiago',
    'E. South America Standard Time': 'America/Sao_Paulo',
    'Newfoundland Standard Time': 'America/St_Johns',
    'Pacific Standard Time': 'America/Tijuana',
    'New Zealand Standard Time': 'Antarctica/McMurdo',
    'UTC-02': 'Atlantic/South_Georgia',
    'Central Asia Standard Time': 'Asia/Almaty',
    'Jordan Standard Time': 'Asia/Amman',
    'Arabic Standard Time': 'Asia/Baghdad',
    'Azerbaijan Standard Time': 'Asia/Baku',
    'SE Asia Standard Time': 'Asia/Bangkok',
    'Middle East Standard Time': 'Asia/Beirut',
    'India Standard Time': 'Asia/Calcutta',
    'Sri Lanka Standard Time': 'Asia/Colombo',
    'Syria Standard Time': 'Asia/Damascus',
    'Bangladesh Standard Time': 'Asia/Dhaka',
    'Arabian Standard Time': 'Asia/Dubai',
    'North Asia East Standard Time': 'Asia/Irkutsk',
    'Israel Standard Time': 'Asia/Jerusalem',
    'Afghanistan Standard Time': 'Asia/Kabul',
    'Kamchatka Standard Time': 'Asia/Kamchatka',
    'Pakistan Standard Time': 'Asia/Karachi',
    'Nepal Standard Time': 'Asia/Katmandu',
    'India Standard Time': 'Asia/Kolkata',
    'North Asia Standard Time': 'Asia/Krasnoyarsk',
    'Singapore Standard Time': 'Asia/Kuala_Lumpur',
    'Arab Standard Time': 'Asia/Kuwait',
    'Magadan Standard Time': 'Asia/Magadan',
    'Arabian Standard Time': 'Asia/Muscat',
    'N. Central Asia Standard Time': 'Asia/Novosibirsk',
    'West Asia Standard Time': 'Asia/Oral',
    'Myanmar Standard Time': 'Asia/Rangoon',
    'Arab Standard Time': 'Asia/Riyadh',
    'Korea Standard Time': 'Asia/Seoul',
    'China Standard Time': 'Asia/Shanghai',
    'Singapore Standard Time': 'Asia/Singapore',
    'Taipei Standard Time': 'Asia/Taipei',
    'West Asia Standard Time': 'Asia/Tashkent',
    'Georgian Standard Time': 'Asia/Tbilisi',
    'Iran Standard Time': 'Asia/Tehran',
    'Tokyo Standard Time': 'Asia/Tokyo',
    'Ulaanbaatar Standard Time': 'Asia/Ulaanbaatar',
    'Vladivostok Standard Time': 'Asia/Vladivostok',
    'Yakutsk Standard Time': 'Asia/Yakutsk',
    'Ekaterinburg Standard Time': 'Asia/Yekaterinburg',
    'Armenian Standard Time': 'Asia/Yerevan',
    'Azores Standard Time': 'Atlantic/Azores',
    'Cape Verde Standard Time': 'Atlantic/Cape_Verde',
    'Greenwich Standard Time': 'Atlantic/Reykjavik',
    'Cen. Australia Standard Time': 'Australia/Adelaide',
    'E. Australia Standard Time': 'Australia/Brisbane',
    'AUS Central Standard Time': 'Australia/Darwin',
    'Tasmania Standard Time': 'Australia/Hobart',
    'W. Australia Standard Time': 'Australia/Perth',
    'AUS Eastern Standard Time': 'Australia/Sydney',
    'UTC': 'Etc/GMT',
    'UTC-11': 'Etc/GMT+11',
    'Dateline Standard Time': 'Etc/GMT+12',
    'UTC-02': 'Etc/GMT+2',
    'UTC+12': 'Etc/GMT-12',
    'W. Europe Standard Time': 'Europe/Amsterdam',
    'GTB Standard Time': 'Europe/Athens',
    'Central Europe Standard Time': 'Europe/Belgrade',
    'W. Europe Standard Time': 'Europe/Berlin',
    'Romance Standard Time': 'Europe/Brussels',
    'Central Europe Standard Time': 'Europe/Budapest',
    'GMT Standard Time': 'Europe/Dublin',
    'FLE Standard Time': 'Europe/Helsinki',
    'GTB Standard Time': 'Europe/Istanbul',
    'FLE Standard Time': 'Europe/Kiev',
    'GMT Standard Time': 'Europe/London',
    'E. Europe Standard Time': 'Europe/Minsk',
    'Russian Standard Time': 'Europe/Moscow',
    'Romance Standard Time': 'Europe/Paris',
    'Central European Standard Time': 'Europe/Sarajevo',
    'Central European Standard Time': 'Europe/Warsaw',
    'Mauritius Standard Time': 'Indian/Mauritius',
    'Samoa Standard Time': 'Pacific/Apia',
    'New Zealand Standard Time': 'Pacific/Auckland',
    'Fiji Standard Time': 'Pacific/Fiji',
    'Central Pacific Standard Time': 'Pacific/Guadalcanal',
    'West Pacific Standard Time': 'Pacific/Guam',
    'Hawaiian Standard Time': 'Pacific/Honolulu',
    'UTC-11': 'Pacific/Pago_Pago',
    'West Pacific Standard Time': 'Pacific/Port_Moresby',
    'Tonga Standard Time': 'Pacific/Tongatapu'
}

timezone.mapWindowsTimeToOlson = function(windowsTimeZone) {
    var olsonTimeZone = windowsTimesToOlsonMappings[windowsTimeZone];
    return olsonTimeZone;
};

module.exports = timezone;