0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Add UTC timezone as default in settings model

no issue

- Changes the default timezone from 'Europe/Dublin' to 'Etc/UTC' in setting model
- Updates acceptance test for settings general to expect more timezones in list and different default
- adds mirage fixtures values
This commit is contained in:
Aileen Nowak 2016-06-10 15:28:11 +02:00
parent 9b8348a0c0
commit 6d22a6dcb6
5 changed files with 119 additions and 180 deletions

View file

@ -210,7 +210,7 @@ export default [
updated_at: '2015-09-23T13:32:49.868Z', updated_at: '2015-09-23T13:32:49.868Z',
updated_by: 1, updated_by: 1,
uuid: '310c9169-9613-48b0-8bc4-d1e1c9be85b8', uuid: '310c9169-9613-48b0-8bc4-d1e1c9be85b8',
value: 'Europe/Dublin' value: 'Etc/UTC'
}, },
{ {
key: 'availableThemes', key: 'availableThemes',

View file

@ -1,327 +1,266 @@
export default [ export default [
{ {
name: 'Pacific/Pago_Pago', name: 'Pacific/Pago_Pago',
label: '(GMT -11:00) Midway Island, Samoa', label: '(GMT -11:00) Midway Island, Samoa'
offset: -660
}, },
{ {
name: 'Pacific/Honolulu', name: 'Pacific/Honolulu',
label: '(GMT -10:00) Hawaii', label: '(GMT -10:00) Hawaii'
offset: -600
}, },
{ {
name: 'America/Anchorage', name: 'America/Anchorage',
label: '(GMT -9:00) Alaska', label: '(GMT -9:00) Alaska'
offset: -540
}, },
{ {
name: 'America/Tijuana', name: 'America/Tijuana',
label: '(GMT -8:00) Chihuahua, La Paz, Mazatlan', label: '(GMT -8:00) Chihuahua, La Paz, Mazatlan'
offset: -480
}, },
{ {
name: 'America/Los_Angeles', name: 'America/Los_Angeles',
label: '(GMT -8:00) Pacific Time (US & Canada); Tijuana', label: '(GMT -8:00) Pacific Time (US & Canada); Tijuana'
offset: -480
}, },
{ {
name: 'America/Phoenix', name: 'America/Phoenix',
label: '(GMT -7:00) Arizona', label: '(GMT -7:00) Arizona'
offset: -420
}, },
{ {
name: 'America/Denver', name: 'America/Denver',
label: '(GMT -7:00) Mountain Time (US & Canada)', label: '(GMT -7:00) Mountain Time (US & Canada)'
offset: -420
}, },
{ {
name: 'America/Costa_Rica', name: 'America/Costa_Rica',
label: '(GMT -6:00) Central America', label: '(GMT -6:00) Central America'
offset: -360
}, },
{ {
name: 'America/Chicago', name: 'America/Chicago',
label: '(GMT -6:00) Central Time (US & Canada)', label: '(GMT -6:00) Central Time (US & Canada)'
offset: -360
}, },
{ {
name: 'America/Mexico_City', name: 'America/Mexico_City',
label: '(GMT -6:00) Guadalajara, Mexico City, Monterrey', label: '(GMT -6:00) Guadalajara, Mexico City, Monterrey'
offset: -360
}, },
{ {
name: 'America/Regina', name: 'America/Regina',
label: '(GMT -6:00) Saskatchewan', label: '(GMT -6:00) Saskatchewan'
offset: -360
}, },
{ {
name: 'America/Bogota', name: 'America/Bogota',
label: '(GMT -5:00) Bogota, Lima, Quito', label: '(GMT -5:00) Bogota, Lima, Quito'
offset: -300
}, },
{ {
name: 'America/New_York', name: 'America/New_York',
label: '(GMT -5:00) Eastern Time (US & Canada)', label: '(GMT -5:00) Eastern Time (US & Canada)'
offset: -300
}, },
{ {
name: 'America/Fort_Wayne', name: 'America/Fort_Wayne',
label: '(GMT -5:00) Indiana (East)', label: '(GMT -5:00) Indiana (East)'
offset: -300
}, },
{ {
name: 'America/Caracas', name: 'America/Caracas',
label: '(GMT -4:30) Caracas, La Paz', label: '(GMT -4:00) Caracas, La Paz'
offset: -270
}, },
{ {
name: 'America/Halifax', name: 'America/Halifax',
label: '(GMT -4:00) Atlantic Time (Canada); Brasilia, Greenland', label: '(GMT -4:00) Atlantic Time (Canada); Brasilia, Greenland'
offset: -240
},
{
name: 'America/St_Johns',
label: '(GMT -3:30) Newfoundland',
offset: -210
},
{
name: 'America/Argentina/Buenos_Aires',
label: '(GMT -3:00) Buenos Aires, Georgetown',
offset: -180
}, },
{ {
name: 'America/Santiago', name: 'America/Santiago',
label: '(GMT -3:00) Santiago', label: '(GMT -4:00) Santiago'
offset: -180 },
{
name: 'America/St_Johns',
label: '(GMT -3:30) Newfoundland'
},
{
name: 'America/Argentina/Buenos_Aires',
label: '(GMT -3:00) Buenos Aires, Georgetown'
}, },
{ {
name: 'America/Noronha', name: 'America/Noronha',
label: '(GMT -2:00) Fernando de Noronha', label: '(GMT -2:00) Fernando de Noronha'
offset: -120
}, },
{ {
name: 'Atlantic/Azores', name: 'Atlantic/Azores',
label: '(GMT -1:00) Azores', label: '(GMT -1:00) Azores'
offset: -60
}, },
{ {
name: 'Atlantic/Cape_Verde', name: 'Atlantic/Cape_Verde',
label: '(GMT -1:00) Cape Verde Is.', label: '(GMT -1:00) Cape Verde Is.'
offset: -60 },
{
name: 'Etc/UTC',
label: '(GMT) UTC'
}, },
{ {
name: 'Africa/Casablanca', name: 'Africa/Casablanca',
label: '(GMT) Casablanca, Monrovia', label: '(GMT +0:00) Casablanca, Monrovia'
offset: 0
}, },
{ {
name: 'Europe/Dublin', name: 'Europe/Dublin',
label: '(GMT) Greenwich Mean Time : Dublin, Edinburgh, London', label: '(GMT +0:00) Dublin, Edinburgh, London'
offset: 0
}, },
{ {
name: 'Europe/Amsterdam', name: 'Europe/Amsterdam',
label: '(GMT +1:00) Amsterdam, Berlin, Rome, Stockholm, Vienna', label: '(GMT +1:00) Amsterdam, Berlin, Rome, Stockholm, Vienna'
offset: 60
}, },
{ {
name: 'Europe/Prague', name: 'Europe/Prague',
label: '(GMT +1:00) Belgrade, Bratislava, Budapest, Prague', label: '(GMT +1:00) Belgrade, Bratislava, Budapest, Prague'
offset: 60
}, },
{ {
name: 'Europe/Paris', name: 'Europe/Paris',
label: '(GMT +1:00) Brussels, Copenhagen, Madrid, Paris', label: '(GMT +1:00) Brussels, Copenhagen, Madrid, Paris'
offset: 60
}, },
{ {
name: 'Europe/Warsaw', name: 'Europe/Warsaw',
label: '(GMT +1:00) Sarajevo, Skopje, Warsaw, Zagreb', label: '(GMT +1:00) Sarajevo, Skopje, Warsaw, Zagreb'
offset: 60
}, },
{ {
name: 'Africa/Lagos', name: 'Africa/Lagos',
label: '(GMT +1:00) West Central Africa', label: '(GMT +1:00) West Central Africa'
offset: 60
}, },
{ {
name: 'Europe/Istanbul', name: 'Europe/Istanbul',
label: '(GMT +2:00) Athens, Beirut, Bucharest, Istanbul', label: '(GMT +2:00) Athens, Beirut, Bucharest, Istanbul'
offset: 120
}, },
{ {
name: 'Africa/Cairo', name: 'Africa/Cairo',
label: '(GMT +2:00) Cairo, Egypt', label: '(GMT +2:00) Cairo, Egypt'
offset: 120
}, },
{ {
name: 'Africa/Maputo', name: 'Africa/Maputo',
label: '(GMT +2:00) Harare', label: '(GMT +2:00) Harare'
offset: 120
}, },
{ {
name: 'Europe/Kiev', name: 'Europe/Kiev',
label: '(GMT +2:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius', label: '(GMT +2:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius'
offset: 120
}, },
{ {
name: 'Asia/Jerusalem', name: 'Asia/Jerusalem',
label: '(GMT +2:00) Jerusalem', label: '(GMT +2:00) Jerusalem'
offset: 120
}, },
{ {
name: 'Africa/Johannesburg', name: 'Africa/Johannesburg',
label: '(GMT +2:00) Pretoria', label: '(GMT +2:00) Pretoria'
offset: 120
}, },
{ {
name: 'Asia/Baghdad', name: 'Asia/Baghdad',
label: '(GMT +3:00) Baghdad', label: '(GMT +3:00) Baghdad'
offset: 180
}, },
{ {
name: 'Asia/Riyadh', name: 'Asia/Riyadh',
label: '(GMT +3:00) Kuwait, Nairobi, Riyadh', label: '(GMT +3:00) Kuwait, Nairobi, Riyadh'
offset: 180
},
{
name: 'Asia/Tehran',
label: '(GMT +3:30) Tehran',
offset: 210
},
{
name: 'Asia/Dubai',
label: '(GMT +4:00) Abu Dhabi, Muscat',
offset: 240
},
{
name: 'Asia/Baku',
label: '(GMT +4:00) Baku, Tbilisi, Yerevan',
offset: 240
}, },
{ {
name: 'Europe/Moscow', name: 'Europe/Moscow',
label: '(GMT +4:00) Moscow, St. Petersburg, Volgograd', label: '(GMT +3:00) Moscow, St. Petersburg, Volgograd'
offset: 240 },
{
name: 'Asia/Tehran',
label: '(GMT +3:30) Tehran'
},
{
name: 'Asia/Dubai',
label: '(GMT +4:00) Abu Dhabi, Muscat'
},
{
name: 'Asia/Baku',
label: '(GMT +4:00) Baku, Tbilisi, Yerevan'
}, },
{ {
name: 'Asia/Kabul', name: 'Asia/Kabul',
label: '(GMT +4:30) Kabul', label: '(GMT +4:30) Kabul'
offset: 270
}, },
{ {
name: 'Asia/Karachi', name: 'Asia/Karachi',
label: '(GMT +5:00) Islamabad, Karachi, Tashkent', label: '(GMT +5:00) Islamabad, Karachi, Tashkent'
offset: 300
},
{
name: 'Asia/Kolkata',
label: '(GMT +5:30) Chennai, Calcutta, Mumbai, New Delhi',
offset: 330
},
{
name: 'Asia/Kathmandu',
label: '(GMT +5:45) Katmandu',
offset: 345
},
{
name: 'Asia/Almaty',
label: '(GMT +6:00) Almaty, Novosibirsk',
offset: 360
},
{
name: 'Asia/Dhaka',
label: '(GMT +6:00) Astana, Dhaka, Sri Jayawardenepura',
offset: 360
}, },
{ {
name: 'Asia/Yekaterinburg', name: 'Asia/Yekaterinburg',
label: '(GMT +6:00) Yekaterinburg', label: '(GMT +5:00) Yekaterinburg'
offset: 360 },
{
name: 'Asia/Kolkata',
label: '(GMT +5:30) Chennai, Calcutta, Mumbai, New Delhi'
},
{
name: 'Asia/Kathmandu',
label: '(GMT +5:45) Katmandu'
},
{
name: 'Asia/Almaty',
label: '(GMT +6:00) Almaty, Novosibirsk'
},
{
name: 'Asia/Dhaka',
label: '(GMT +6:00) Astana, Dhaka, Sri Jayawardenepura'
}, },
{ {
name: 'Asia/Rangoon', name: 'Asia/Rangoon',
label: '(GMT +6:30) Rangoon', label: '(GMT +6:30) Rangoon'
offset: 390
}, },
{ {
name: 'Asia/Bangkok', name: 'Asia/Bangkok',
label: '(GMT +7:00) Bangkok, Hanoi, Jakarta', label: '(GMT +7:00) Bangkok, Hanoi, Jakarta'
offset: 420
},
{
name: 'Asia/Hong_Kong',
label: '(GMT +8:00) Beijing, Chongqing, Hong Kong, Urumqi',
offset: 480
}, },
{ {
name: 'Asia/Krasnoyarsk', name: 'Asia/Krasnoyarsk',
label: '(GMT +8:00) Krasnoyarsk', label: '(GMT +7:00) Krasnoyarsk'
offset: 480
}, },
{ {
name: 'Asia/Singapore', name: 'Asia/Hong_Kong',
label: '(GMT +8:00) Kuala Lumpur, Perth, Singapore, Taipei', label: '(GMT +8:00) Beijing, Chongqing, Hong Kong, Urumqi'
offset: 480
}, },
{ {
name: 'Asia/Irkutsk', name: 'Asia/Irkutsk',
label: '(GMT +9:00) Irkutsk, Ulaan Bataar', label: '(GMT +8:00) Irkutsk, Ulaan Bataar'
offset: 540 },
{
name: 'Asia/Singapore',
label: '(GMT +8:00) Kuala Lumpur, Perth, Singapore, Taipei'
}, },
{ {
name: 'Asia/Tokyo', name: 'Asia/Tokyo',
label: '(GMT +9:00) Osaka, Sapporo, Tokyo', label: '(GMT +9:00) Osaka, Sapporo, Tokyo'
offset: 540
}, },
{ {
name: 'Asia/Seoul', name: 'Asia/Seoul',
label: '(GMT +9:00) Seoul', label: '(GMT +9:00) Seoul'
offset: 540
},
{
name: 'Australia/Darwin',
label: '(GMT +9:30) Darwin',
offset: 570
},
{
name: 'Australia/Brisbane',
label: '(GMT +10:00) Brisbane, Guam, Port Moresby',
offset: 600
}, },
{ {
name: 'Asia/Yakutsk', name: 'Asia/Yakutsk',
label: '(GMT +10:00) Yakutsk', label: '(GMT +9:00) Yakutsk'
offset: 600
}, },
{ {
name: 'Australia/Adelaide', name: 'Australia/Adelaide',
label: '(GMT +10:30) Adelaide', label: '(GMT +9:30) Adelaide'
offset: 630 },
{
name: 'Australia/Darwin',
label: '(GMT +9:30) Darwin'
},
{
name: 'Australia/Brisbane',
label: '(GMT +10:00) Brisbane, Guam, Port Moresby'
}, },
{ {
name: 'Australia/Sydney', name: 'Australia/Sydney',
label: '(GMT +11:00) Canberra, Hobart, Melbourne, Sydney, Vladivostok', label: '(GMT +10:00) Canberra, Hobart, Melbourne, Sydney, Vladivostok'
offset: 660
},
{
name: 'Pacific/Fiji',
label: '(GMT +12:00) Fiji, Kamchatka, Marshall Is.',
offset: 720
},
{
name: 'Pacific/Kwajalein',
label: '(GMT +12:00) International Date Line West',
offset: 720
}, },
{ {
name: 'Asia/Magadan', name: 'Asia/Magadan',
label: '(GMT +12:00) Magadan, Soloman Is., New Caledonia', label: '(GMT +11:00) Magadan, Soloman Is., New Caledonia'
offset: 720
}, },
{ {
name: 'Pacific/Auckland', name: 'Pacific/Auckland',
label: '(GMT +13:00) Auckland, Wellington', label: '(GMT +12:00) Auckland, Wellington'
offset: 780 },
{
name: 'Pacific/Fiji',
label: '(GMT +12:00) Fiji, Kamchatka, Marshall Is.'
},
{
name: 'Pacific/Kwajalein',
label: '(GMT +12:00) International Date Line West'
} }
]; ];

View file

@ -16,7 +16,7 @@ export default Model.extend(ValidationEngine, {
permalinks: attr('string'), permalinks: attr('string'),
activeTheme: attr('string'), activeTheme: attr('string'),
availableThemes: attr(), availableThemes: attr(),
activeTimezone: attr('string', {defaultValue: 'Europe/Dublin'}), activeTimezone: attr('string', {defaultValue: 'Etc/UTC'}),
ghost_head: attr('string'), ghost_head: attr('string'),
ghost_foot: attr('string'), ghost_foot: attr('string'),
facebook: attr('facebook-url-user'), facebook: attr('facebook-url-user'),

View file

@ -225,7 +225,7 @@ describe('Acceptance: Editor', function() {
expect(currentURL(), 'currentURL for settings') expect(currentURL(), 'currentURL for settings')
.to.equal('/settings/general'); .to.equal('/settings/general');
expect(find('#activeTimezone option:selected').text().trim(), 'default timezone') expect(find('#activeTimezone option:selected').text().trim(), 'default timezone')
.to.equal('(GMT) Greenwich Mean Time : Dublin, Edinburgh, London'); .to.equal('(GMT) UTC');
// select a new timezone // select a new timezone
find('#activeTimezone option[value="Pacific/Auckland"]').prop('selected', true); find('#activeTimezone option[value="Pacific/Auckland"]').prop('selected', true);
}); });
@ -236,7 +236,7 @@ describe('Acceptance: Editor', function() {
andThen(() => { andThen(() => {
expect(find('#activeTimezone option:selected').text().trim(), 'new timezone after saving') expect(find('#activeTimezone option:selected').text().trim(), 'new timezone after saving')
.to.equal('(GMT +13:00) Auckland, Wellington'); .to.equal('(GMT +12:00) Auckland, Wellington');
}); });
// and now go back to the editor // and now go back to the editor
@ -246,7 +246,7 @@ describe('Acceptance: Editor', function() {
expect(currentURL(), 'currentURL in editor') expect(currentURL(), 'currentURL in editor')
.to.equal('/editor/2'); .to.equal('/editor/2');
expect(find('input[name="post-setting-date"]').val(), 'date with timezone offset') expect(find('input[name="post-setting-date"]').val(), 'date with timezone offset')
.to.equal('10 May 16 @ 21:00'); .to.equal('10 May 16 @ 22:00');
}); });
}); });
}); });

View file

@ -140,8 +140,8 @@ describe('Acceptance: Settings - General', function () {
andThen(() => { andThen(() => {
expect(currentURL(), 'currentURL').to.equal('/settings/general'); expect(currentURL(), 'currentURL').to.equal('/settings/general');
expect(find('#activeTimezone select option').length, 'available timezones').to.equal(65); expect(find('#activeTimezone select option').length, 'available timezones').to.equal(66);
expect(find('#activeTimezone option:selected').text().trim()).to.equal('(GMT) Greenwich Mean Time : Dublin, Edinburgh, London'); expect(find('#activeTimezone option:selected').text().trim()).to.equal('(GMT) UTC');
find('#activeTimezone option[value="Africa/Cairo"]').prop('selected', true); find('#activeTimezone option[value="Africa/Cairo"]').prop('selected', true);
}); });