/arkcompiler/ets_runtime/ecmascript/ |
D | js_date.cpp | 48 bool DateUtils::IsLeap(int64_t year) in IsLeap() argument 50 …return year % LEAP_NUMBER[0] == 0 && (year % LEAP_NUMBER[1] != 0 || year % LEAP_NUMBER[2] == 0); … in IsLeap() 54 int64_t DateUtils::GetDaysInYear(int64_t year) in GetDaysInYear() argument 56 int64_t number = IsLeap(year) ? (DAYS_IN_YEAR + 1) : DAYS_IN_YEAR; in GetDaysInYear() 61 int64_t DateUtils::GetDaysFromYear(int64_t year) in GetDaysFromYear() argument 63 … return DAYS_IN_YEAR * (year - YEAR_NUMBER[0]) + FloorDiv(year - YEAR_NUMBER[1], LEAP_NUMBER[0]) - in GetDaysFromYear() 64 FloorDiv(year - YEAR_NUMBER[2], LEAP_NUMBER[1]) + // 2: year index in GetDaysFromYear() 65 FloorDiv(year - YEAR_NUMBER[3], LEAP_NUMBER[2]); // 3, 2: year index in GetDaysFromYear() 110 int64_t year = y + (month <= MONTH_COEFFICIENT); in GetYearFromDays() local 113 (*date)[YEAR] = year; in GetYearFromDays() [all …]
|
D | date_parse.cpp | 59 int year = proxy->NextDate().GetValue(); in IsIsoDateTime() local 60 dayValue->SetData(year); in IsIsoDateTime() 386 int year = 0; in SetDayValue() local 395 year = data_[YEAR]; in SetDayValue() 401 year = data_[2]; // 2:index of year in SetDayValue() 406 year = data_[0]; // 0:index of year in SetDayValue() 419 year = data_[0]; in SetDayValue() 423 year = data_[1]; in SetDayValue() 430 if (IsBetween(year, 1, 49)) { // if year is between 1-49 in SetDayValue() 431 year += 2000; // it means 2001-2049 in SetDayValue() [all …]
|
D | js_date.h | 70 static bool IsLeap(int64_t year); 71 static int64_t GetDaysInYear(int64_t year); 72 static int64_t GetDaysFromYear(int64_t year); 94 static double MakeDay(double year, double month, double date); 161 static double SetDateValues(int64_t year, int64_t month, int64_t day);
|
D | js_relative_time_format.cpp | 196 JSHandle<EcmaString> year = JSHandle<EcmaString>::Cast(globalConst->GetHandledYearString()); in SingularUnitToIcuUnit() local 228 } else if (EcmaStringAccessor::StringsAreEqual(*year, *unit) || in SingularUnitToIcuUnit() 311 JSHandle<EcmaString> year = JSHandle<EcmaString>::Cast(globalConst->GetHandledYearString()); in SingularUnitString() local 350 …if (EcmaStringAccessor::StringsAreEqual(*year, *unit) || EcmaStringAccessor::StringsAreEqual(*year… in SingularUnitString() 351 return year; in SingularUnitString()
|
D | object_fast_operator-inl.h | 571 int year = 0; in FastParseDate() local 580 if (!GetNumFromString(data, len, &index, &year)) { in FastParseDate() 595 double day = JSDate::MakeDay(year, month - 1, date); in FastParseDate()
|
/arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/ |
D | Date.ets | 44 /** Days in a year */ 47 /** Days in a leap year */ 66 /** First day of a month in a year */ 68 /** First day of a month in a leap year */ 72 * Returns first day with respect to year and month 74 * @param year 80 function getFirstDayInMonth(year: int, month: int): int { 81 assert (year == 0 || year == 1) && (month >= 0 && month <= 11) : "Invalid year/month pair"; 82 if (year == 0) { 104 * @returns number of days in the given year. [all …]
|
/arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/time/ |
D | DateConstructorTest.ets | 20 failures += test(testIntYearMonthConstructor(), "Test year and month constructor with Long"); 21 …failures += test(testIntYearMonthDayConstructor(), "Test year, month and day constructor with Long… 28 … failures += test(testDoubleYearMonthConstructor(), "Test year and month constructor with Double"); 29 …failures += test(testDoubleYearMonthDayConstructor(), "Test year, month and day constructor with D… 355 function checkDateWithLongYMD(date: Date, year: long, month: long, day: long): int { 356 return checkDateWithLongYMDH(date, year, month, day, 0); 359 function checkDateWithLongYMDH(date: Date, year: long, month: long, day: long, hour: long): int { 360 return checkDateWithLongYMDHM(date, year, month, day, hour, 0); 363 function checkDateWithLongYMDHM(date: Date, year: long, month: long, day: long, hour: long, minutes… 364 return checkDateWithLongYMDHMS(date, year, month, day, hour, minutes, 0); [all …]
|
D | DateChangeTest.ets | 19 failures += test(testDateChangeYear(), "Try to change date's year"); 26 // next test raises assert "Invalid year/month pair" 42 let year = date.getFullYear(); 43 date.setFullYear(year - 1); 45 if(date.getFullYear() == (year - 1)) return 0;
|
/arkcompiler/ets_runtime/test/moduletest/regress/ |
D | regress.js | 232 …const datesList = [{ year: '2021', month: '10', day: '22', hour: '10', minute: '12', second: '32' … property 233 { year: '2021', month: '8', day: '3', hour: '9', minute: '9', second: '6' }]; property 234 const { year, month, day, hour, minute, second } = datesList[0]; 235 const s0 = `${year}-${month}-${day} ${hour}:${minute}:${second}Z`; 237 const s1 = `${'0'.repeat(i) + year}-${month}-${day} ${hour}:${minute}:${second}Z`;
|
/arkcompiler/ets_runtime/ecmascript/compiler/builtins/ |
D | builtins_stubs.h | 145 inline GateRef IsNumberYearMonthDay(GateRef year, GateRef month, GateRef day) in IsNumberYearMonthDay() argument 147 GateRef condition = BoolAnd(TaggedIsNumber(year), TaggedIsNumber(month)); in IsNumberYearMonthDay()
|
D | builtins_stubs.cpp | 514 GateRef year = GetArgNCheck(IntPtr(0)); in DECLARE_BUILTINS() local 517 Branch(IsNumberYearMonthDay(year, month, day), &numberYearMonthDay, &slowPath); in DECLARE_BUILTINS() 520 GateRef y = GetDoubleOfTNumber(year); in DECLARE_BUILTINS()
|
/arkcompiler/ets_runtime/ecmascript/tests/ |
D | js_date_time_format_second_test.cpp | 303 …auto year = JSTaggedValue::GetProperty(thread, JSHandle<JSTaggedValue>::Cast(dateTimeArray1), 0).G… in HWTEST_F_L0() local 308 EXPECT_STREQ(GetDateTimePartStringTest(thread, typeKey, year).c_str(), "year"); in HWTEST_F_L0() 309 EXPECT_STREQ(GetDateTimePartStringTest(thread, valueKey, year).c_str(), "2022"); in HWTEST_F_L0() 363 …auto year = JSTaggedValue::GetProperty(thread, JSHandle<JSTaggedValue>::Cast(dateTimeArray), 0).Ge… in HWTEST_F_L0() local 379 EXPECT_STREQ(GetDateTimePartStringTest(thread, typeKey, year).c_str(), "year"); in HWTEST_F_L0() 380 EXPECT_STREQ(GetDateTimePartStringTest(thread, valueKey, year).c_str(), "22"); in HWTEST_F_L0()
|
/arkcompiler/ets_runtime/ecmascript/builtins/tests/ |
D | builtins_date_time_format_first_test.cpp | 149 static double BuiltinsDateCreate(const double year, const double month, const double date) in BuiltinsDateCreate() argument 151 const double day = JSDate::MakeDay(year, month, date); in BuiltinsDateCreate()
|
/arkcompiler/runtime_core/static_core/tests/tests-u-runner/test-lists/test262/ |
D | test262-excluded.txt | 1729 annexB/built-ins/Date/prototype/setYear/year-nan.js 1730 annexB/built-ins/Date/prototype/setYear/year-number-absolute.js 1731 annexB/built-ins/Date/prototype/setYear/year-number-relative.js 1732 annexB/built-ins/Date/prototype/setYear/year-to-number-err.js 2607 built-ins/Date/parse/year-zero.js 2627 built-ins/Date/year-zero.js 3426 built-ins/Temporal/Calendar/prototype/dateAdd/argument-propertybag-calendar-year-zero.js 3458 built-ins/Temporal/Calendar/prototype/dateAdd/year-zero.js 3477 built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day-need-constrain.js 3478 built-ins/Temporal/Calendar/prototype/dateFromFields/with-year-month-day.js [all …]
|
/arkcompiler/ets_runtime/ecmascript/ts_types/ |
D | lib_ark_builtins.d.ts | 204 …constructor(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?… 244 setFullYear(year: number, month?: number, date?: number): number; 260 setUTCFullYear(year: number, month?: number, date?: number): number; 294 …static UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?:…
|
/arkcompiler/runtime_core/static_core/plugins/ets/doc/stdlib/packages/ |
D | escompat.rst | 7108 constructor(year\: :kw:`number`, month\: :kw:`number`)\: :kw:`void` 7112 | **Description\:** Initialize \`Date\` instance with year and month given. 7116 - year\: :kw:`number` 7129 |nbsp| year\: :kw:`number`, 7136 | **Description\:** Initialize \`Date\` instance with year, month and day given. 7140 - year\: :kw:`number` 7154 |nbsp| year\: :kw:`number`, 7162 | **Description\:** Initialize \`Date\` instance with year, month, day and hours given. 7166 - year\: :kw:`number` 7181 |nbsp| year\: :kw:`number`, [all …]
|
/arkcompiler/ets_frontend/test262/ |
D | intl_tests.txt | 184 intl402/DateTimeFormat/prototype/format/related-year-zh.js 204 intl402/DateTimeFormat/prototype/formatToParts/related-year-zh.js 205 intl402/DateTimeFormat/prototype/formatToParts/related-year.js
|
D | es5_tests.txt | 10 annexB/built-ins/Date/prototype/setYear/year-nan.js 11 annexB/built-ins/Date/prototype/setYear/year-number-absolute.js 12 annexB/built-ins/Date/prototype/setYear/year-number-relative.js 13 annexB/built-ins/Date/prototype/setYear/year-to-number-err.js
|
/arkcompiler/ets_runtime/ecmascript/stubs/ |
D | runtime_stubs.cpp | 2930 double RuntimeStubs::SetDateValues(double year, double month, double day) in SetDateValues() argument 2932 …if (std::isnan(year) || !std::isfinite(year) || std::isnan(month) || !std::isfinite(month) || std:… in SetDateValues() 2937 …return JSDate::SetDateValues(static_cast<int64_t>(year), static_cast<int64_t>(month), static_cast<… in SetDateValues()
|
D | runtime_stubs.h | 473 static double SetDateValues(double year, double month, double day);
|
/arkcompiler/ets_frontend/es2panda/test/ |
D | test262skiplist.txt | 5092 annexB/built-ins/Date/prototype/setYear/year-nan.js 5093 annexB/built-ins/Date/prototype/setYear/year-number-absolute.js 5094 annexB/built-ins/Date/prototype/setYear/year-number-relative.js 5095 annexB/built-ins/Date/prototype/setYear/year-to-number-err.js 5721 built-ins/Date/UTC/year-offset.js 7172 intl402/DateTimeFormat/prototype/format/related-year-zh.js 7208 intl402/DateTimeFormat/prototype/formatToParts/related-year-zh.js 7209 intl402/DateTimeFormat/prototype/formatToParts/related-year.js
|