Skip to content

Commit

Permalink
disable non-continuous day-of-month nudging for old calendars until r…
Browse files Browse the repository at this point in the history
…est of codebase can catch up
  • Loading branch information
arshaw committed Mar 2, 2024
1 parent 226d3a7 commit 81366ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ built-ins/Temporal/Duration/prototype/subtract/calendar-dateadd.js
# to get the PlainYearMonth to start-of-month for add/subtract/until/since,
# despite the risk of ICU updating historic calendars for skipped days in months.
# Better for tree-shaking.
# Our createIntlYearMonthCache makes this assumption too.
# `createIntlYearMonthCache` makes this assumption too (tho nudging is possible)
# Very hard for `computeIntlEpochMilli`
#
built-ins/Temporal/PlainYearMonth/prototype/since/calendar-datefromfields-called-with-options-undefined.js
built-ins/Temporal/PlainYearMonth/prototype/since/calendar-fields-iterable.js
Expand Down
2 changes: 2 additions & 0 deletions packages/temporal-polyfill/src/internal/intlMath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ function createIntlYearMonthCache(
// move to start-of-month
epochMilli += (1 - intlFields.day) * milliInDay

/*
// Calendar systems could skip days-in-month in olden times
// https://github.com/tc39/proposal-temporal/issues/1315#issuecomment-781264909
// If any days-in-month were skipped, epochMilli would be moved *before*
Expand All @@ -120,6 +121,7 @@ function createIntlYearMonthCache(
epochMilli += milliInDay
}
}
*/

// only record the epochMilli if current year
if (intlFields.year === year) {
Expand Down

0 comments on commit 81366ef

Please sign in to comment.