• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include 'src/objects/js-date-time-format.h'
6
7type DateTimeStyle extends int32 constexpr 'JSDateTimeFormat::DateTimeStyle';
8type HourCycle extends int32 constexpr 'JSDateTimeFormat::HourCycle';
9bitfield struct JSDateTimeFormatFlags extends uint31 {
10  hour_cycle: HourCycle: 3 bit;
11  date_style: DateTimeStyle: 3 bit;
12  time_style: DateTimeStyle: 3 bit;
13  // ICU report the same type "gregorian" for both "gregorian" calendar and
14  // "iso8601" calendar and the same type "islamic" for both "islamic" and
15  // "islamic-rgsa" calendar. We use the alt_calendar bit to distinguish between
16  // them. When the type is "gregorian" and the alt_calendar bit is set, it is
17  // "iso8601", otherwise the true "gregorian" calendar. While the type is
18  // "islamic" and the alt_calendar bit is set, it is "islamic-rgsa" calendar,
19  // otherwise "islamic" calendar.
20  alt_calendar: bool: 1bit;
21}
22
23extern class JSDateTimeFormat extends JSObject {
24  locale: String;
25  icu_locale: Foreign;                // Managed<icu::Locale>
26  icu_simple_date_format: Foreign;    // Managed<icu::SimpleDateFormat>
27  icu_date_interval_format: Foreign;  // Managed<icu::DateIntervalFormat>
28  bound_format: JSFunction|Undefined;
29  flags: SmiTagged<JSDateTimeFormatFlags>;
30}
31