Lines Matching defs:year

61   int32_t year;
73 int32_t year;
157 void BalanceISODate(Isolate* isolate, int32_t* year, int32_t* month,
183 Isolate* isolate, int32_t year, int32_t month, int32_t day, int32_t hour,
223 MaybeHandle<BigInt> GetEpochFromISOParts(Isolate* isolate, int32_t year,
233 int32_t ISODaysInMonth(Isolate* isolate, int32_t year, int32_t month);
236 int32_t ISODaysInYear(Isolate* isolate, int32_t year);
242 bool IsValidISODate(Isolate* isolate, int32_t year, int32_t month, int32_t day);
249 void BalanceISOYearMonth(Isolate* isolate, int32_t* year, int32_t* month);
370 bool ISODateTimeWithinLimits(Isolate* isolate, int32_t year, int32_t month,
378 * Take a short cut and use pre-calculated year/month/day boundary instead.
391 if (year > -25407 && year < 29346) return true;
392 if (year < -25407 || year > 29346) return false;
393 if (year == -25407) {
398 DCHECK_EQ(year, 29346);
403 // 1. Assert: year, month, day, hour, minute, second, millisecond,
405 // 2. Let ns be ! GetEpochFromISOParts(year, month, day, hour, minute,
413 bool ISOYearMonthWithinLimits(int32_t year, int32_t month) {
415 // 1. Assert: year and month are integers.
416 // 2. If year < −271821 or year > 275760, then
418 if (year < -271821 || year > 275760) return false;
419 // 3. If year is −271821 and month < 4, then
421 if (year == -271821 && month < 4) return false;
422 // 4. If year is 275760 and month > 9, then
424 if (year == 275760 && month > 9) return false;
1026 int year = 0;
1034 isolate->date_cache()->BreakDownTime(epoch_milliseconds, &year, &month, &day,
1037 // 3. Let year be ! YearFromTime(epochMilliseconds).
1038 result.year = year;
1076 DateTimeRecordCommon BalanceISODateTime(Isolate* isolate, int32_t year,
1083 // 1. Assert: year, month, day, hour, minute, second, millisecond,
1089 // 3. Let balancedDate be ! BalanceISODate(year, month, day +
1092 BalanceISODate(isolate, &year, &month, &day);
1099 return {year,
1133 result = BalanceISODateTime(isolate, result.year, result.month, result.day,
1142 isolate, result.year, result.month, result.day, result.hour,
1330 isolate, earlier.year, earlier.month, earlier.day, earlier.hour,
1382 isolate, later.year, later.month, later.day, later.hour, later.minute,
1848 // "monthCode", "year" »).
1884 DCHECK(IsValidISODate(isolate, result.year, result.month, result.day));
1899 return CreateTemporalDate(isolate, result.year, result.month, result.day,
2286 // 5. Set year to ! ToIntegerOrInfinity(year).
2287 result.year = parsed.date_year;
2340 // 16. If ! IsValidISODate(year, month, day) is false, throw a RangeError
2342 if (!IsValidISODate(isolate, result.year, result.month, result.day)) {
2353 // 18. Return the Record { [[Year]]: year, [[Month]]: month, [[Day]]: day,
2399 DateRecord ret = {result.year, result.month, result.day, result.calendar};
2488 record.year = result.year;
2524 GetEpochFromISOParts(isolate, result.year, result.month, result.day,
3133 CALENDAR_ABSTRACT_OPERATION_INT_ACTION(Year, year, ToIntegerThrowOnInfinity)
3420 // 1. If either u1 or u2 is "year", return "year".
3472 void BalanceISODate(Isolate* isolate, int32_t* year, int32_t* month,
3476 // 1. Assert: year, month, and day are integers.
3477 // 2. Let balancedYearMonth be ! BalanceISOYearMonth(year, month).
3479 // 4. Set year to balancedYearMonth.[[Year]].
3480 BalanceISOYearMonth(isolate, year, month);
3482 // greater than the number of days in a year, the following section subtracts
3485 // a. Let testYear be year.
3487 // a. Let testYear be year − 1.
3488 int32_t test_year = (*month > 2) ? *year : *year - 1;
3494 // b. Set year to year − 1.
3495 (*year)--;
3500 // year, the following section adds years and subtracts days until the number
3502 // 10. Let testYear be year + 1.
3503 test_year = (*year) + 1;
3508 // b. Set year to year + 1.
3509 (*year)++;
3518 // a. Set balancedYearMonth to ! BalanceISOYearMonth(year, month − 1).
3519 // b. Set year to balancedYearMonth.[[Year]].
3522 BalanceISOYearMonth(isolate, year, month);
3523 // d. Set day to day + ! ISODaysInMonth(year, month).
3524 *day += ISODaysInMonth(isolate, *year, *month);
3529 // 15. Repeat, while day > ! ISODaysInMonth(year, month),
3531 while (*day > (iso_days_in_month = ISODaysInMonth(isolate, *year, *month))) {
3532 // a. Set day to day − ! ISODaysInMonth(year, month).
3534 // b. Set balancedYearMonth to ! BalanceISOYearMonth(year, month + 1).
3535 // c. Set year to balancedYearMonth.[[Year]].
3538 BalanceISOYearMonth(isolate, year, month);
3540 // 16. Return the new Record { [[Year]]: year, [[Month]]: month, [[Day]]: day
3547 Isolate* isolate, int32_t year, int32_t month, int32_t day, int32_t hour,
3553 // 1. Assert: year, month, day, hour, minute, second, millisecond,
3563 // 3. Let datePart be ? CreateTemporalDate(year, month, day, calendar).
3567 CreateTemporalDate(isolate, year, month, day, calendar),
3590 time_result.year = added_date->iso_year();
3651 // 4. If largestUnit is one of "year", "month", "week", or "day", then
3676 // 10. If largestUnit is "year", "month", "week", "day", or "hour", then
4316 MaybeHandle<BigInt> GetEpochFromISOParts(Isolate* isolate, int32_t year,
4323 // 1. Assert: year, month, day, hour, minute, second, millisecond,
4325 // 2. Assert: ! IsValidISODate(year, month, day) is true.
4326 DCHECK(IsValidISODate(isolate, year, month, day));
4331 // 4. Let date be ! MakeDay(?(year), ?(month − 1), ?(day)).
4332 double date = MakeDay(year, month - 1, day);
4415 bool IsISOLeapYear(Isolate* isolate, int32_t year) {
4418 // 1. Assert: year is an integer.
4419 // 2. If year modulo 4 ≠ 0, return false.
4420 // 3. If year modulo 400 = 0, return true.
4421 // 4. If year modulo 100 = 0, return false.
4423 return isolate->date_cache()->IsLeap(year);
4427 int32_t ISODaysInMonth(Isolate* isolate, int32_t year, int32_t month) {
4430 // 1. Assert: year is an integer.
4439 // 5. If ! IsISOLeapYear(year) is true, return 29.
4440 return IsISOLeapYear(isolate, year) ? 29 : 28;
4445 int32_t ISODaysInYear(Isolate* isolate, int32_t year) {
4448 // 1. Assert: year is an integer.
4449 // 2. If ! IsISOLeapYear(year) is true, then
4452 return IsISOLeapYear(isolate, year) ? 366 : 365;
4482 bool IsValidISODate(Isolate* isolate, int32_t year, int32_t month,
4486 // 1. Assert: year, month, and day are integers.
4490 // 3. Let daysInMonth be ! ISODaysInMonth(year, month).
4493 if (day < 1 || day > ISODaysInMonth(isolate, year, month)) return false;
4521 void BalanceISOYearMonth(Isolate* isolate, int32_t* year, int32_t* month) {
4524 // 1. Assert: year and month are integers.
4525 // 2. Set year to year + floor((month - 1) / 12).
4526 *year += floor_divide((*month - 1), 12);
4530 // 4. Return the new Record { [[Year]]: year, [[Month]]: month }.
4924 int32_t ToISODayOfYear(Isolate* isolate, int32_t year, int32_t month,
4928 // 1. Assert: year is an integer.
4931 // 4. Let date be the date given by year, month, and day.
4932 // 5. Return date's ordinal date in the year according to ISO-8601.
4935 return day + isolate->date_cache()->DaysFromYearMonth(year, month - 1) -
4936 isolate->date_cache()->DaysFromYearMonth(year, 0);
4947 int32_t ToISODayOfWeek(Isolate* isolate, int32_t year, int32_t month,
4951 // 1. Assert: year is an integer.
4954 // 4. Let date be the date given by year, month, and day.
4963 isolate->date_cache()->DaysFromYearMonth(year, month - 1) + day - 1);
4971 int32_t year, int32_t* month, int32_t* day) {
4974 // 1. Assert: year, month, and day are integers.
4979 // a. If ! IsValidISODate(year, month, day) is false, throw a RangeError
4981 if (!IsValidISODate(isolate, year, *month, *day)) {
4985 // b. Return the Record { [[Year]]: year, [[Month]]: month, [[Day]]: day
4992 // b. Set day to ! ConstrainToRange(day, 1, ! ISODaysInMonth(year,
4994 *day = std::max(std::min(*day, ISODaysInMonth(isolate, year, *month)), 1);
4995 // c. Return the Record { [[Year]]: year, [[Month]]: month, [[Day]]: day
5085 const char* method_name, int32_t* year,
5095 // "monthCode", "year" », «»).
5107 // 4. Let year be ? Get(fields, "year").
5113 // 5. If year is undefined, throw a TypeError exception.
5118 // Note: "year" in fields is always converted by
5122 *year = FastD2I(year_obj->Number());
5145 // 9. Return ? RegulateISODate(year, month, day, overflow).
5146 return RegulateISODate(isolate, maybe_overflow.FromJust(), *year, month, day);
5173 int32_t year;
5175 year = Handle<JSTemporalPlainDate>::cast(temporal_date_like)->iso_year();
5177 year =
5181 year =
5184 int32_t days_in_year = ISODaysInYear(isolate, year);
5212 int32_t year;
5215 year = Handle<JSTemporalPlainDate>::cast(temporal_date_like)->iso_year();
5218 year =
5224 year =
5229 return handle(Smi::FromInt(ISODaysInMonth(isolate, year, month)), isolate);
5232 // #sec-temporal.calendar.prototype.year
5250 "Temporal.Calendar.prototype.year"),
5254 // a. Let year be ! ISOYear(temporalDateLike).
5255 int32_t year;
5257 year = Handle<JSTemporalPlainDate>::cast(temporal_date_like)->iso_year();
5259 year =
5263 year =
5267 // 6. Return ?(year).
5268 return handle(Smi::FromInt(year), isolate);
5368 int32_t year;
5370 year = Handle<JSTemporalPlainDate>::cast(temporal_date_like)->iso_year();
5372 year =
5376 year =
5379 return isolate->factory()->ToBoolean(IsISOLeapYear(isolate, year));
5427 int32_t year;
5432 isolate, fields, options, method_name, &year, &month, &day);
5437 return CreateTemporalDate(isolate, year, month, day, calendar);