Skip to content
Snippets Groups Projects
Commit c0e494eb authored by Rick Waldron's avatar Rick Waldron
Browse files

Merge branch 'patch-1' of git://github.com/phistuck/test262 into phistuck-patch-1

* 'patch-1' of git://github.com/phistuck/test262:
  Added a legal part types test
parents 9ddd49d4 2afcf1d3
No related branches found
No related tags found
No related merge requests found
......@@ -38,3 +38,39 @@ compareFTPtoFormat(['ar'], {
day: 'numeric',
year: '2-digit'
}, Date.now());
const actualPartTypes = new Intl.DateTimeFormat('en-us', {
weekday: 'long',
era: 'long',
year: 'numeric',
month: 'numeric',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
hour12: true,
timeZone: 'UTC',
timeZoneName: 'long'
}).formatToParts(Date.UTC(2012, 11, 17, 3, 0, 42))
.map(function (part) { return part.type; });
const legalPartTypes = [
"weekday",
"era",
"year",
"month",
"day",
"hour",
"minute",
"second",
"literal",
"dayPeriod",
"timeZoneName"
];
actualPartTypes.forEach(
function (type) {
assert(
legalPartTypes.indexOf(type) !== -1,
type + " is not a legal type");
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment