v8/test/intl/displaynames/calendar-v2.js
Frank Tang c0f90e5923 Implement DisplayNames v2
Add "calendar", and "dateTimeField"
Add option for languageDisplay

https://tc39.es/intl-displaynames-v2/
https://chromestatus.com/feature/5082027281874944
Design Doc:
https://docs.google.com/document/d/17hQz4nOC7PJYhxc_MU-BRoT6BnYGZv66XlU1iGX0ywQ/edit#

Bug: v8:11637
Change-Id: Ie7dc80d16956f0e668b11e600e47f5bafb081ff7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2924523
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75027}
2021-06-08 17:49:36 +00:00

21 lines
786 B
JavaScript

// Copyright 2021 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.islamic'
// Flags: --harmony_intl_displaynames_v2
const calendars = [
'buddhist', 'chinese', 'coptic', 'dangi', 'ethioaa', 'ethiopic-amete-alem',
'ethiopic', 'gregory', 'hebrew', 'indian', 'islamic', 'islamic-umalqura',
'islamic-tbla', 'islamic-civil', 'islamic-rgsa', 'iso8601', 'japanese',
'persian', 'roc'
];
let en = new Intl.DisplayNames("en", {type: 'calendar'});
let zh = new Intl.DisplayNames("zh", {type: 'calendar'});
calendars.forEach(function(calendar) {
assertFalse(en.of(calendar) == zh.of(calendar),
calendar + ":" + en.of(calendar) + " == " +
zh.of(calendar));
});