| 1 |
// Copyright 2012 Mozilla Corporation. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
es5id: 6.4_a |
| 6 |
description: Tests that valid time zone names are accepted. |
| 7 |
author: Norbert Lindenberg |
| 8 |
---*/ |
| 9 |
|
| 10 |
var validTimeZoneNames = [ |
| 11 |
"UTC", |
| 12 |
"utc" // time zone names are case-insensitive |
| 13 |
]; |
| 14 |
|
| 15 |
validTimeZoneNames.forEach(function (name) { |
| 16 |
// this must not throw an exception for a valid time zone name |
| 17 |
var format = new Intl.DateTimeFormat(["de-de"], {timeZone: name}); |
| 18 |
assert.sameValue(format.resolvedOptions().timeZone, name.toUpperCase(), "Time zone name " + name + " was not correctly accepted."); |
| 19 |
}); |