Skip to content

Commit

Permalink
Emit reference information when calendarName = 'always'
Browse files Browse the repository at this point in the history
closes tc39#1971
  • Loading branch information
jessealama committed Feb 4, 2022
1 parent e51a281 commit b79de07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions polyfill/lib/ecmascript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ export const ES = ObjectAssign({}, ES2020, {
let resultString = `${month}-${day}`;
const calendar = GetSlot(monthDay, CALENDAR);
const calendarID = ES.ToString(calendar);
if (calendarID !== 'iso8601') {
if (showCalendar === 'always' || calendarID !== 'iso8601') {
const year = ES.ISOYearString(GetSlot(monthDay, ISO_YEAR));
resultString = `${year}-${resultString}`;
}
Expand All @@ -2150,7 +2150,7 @@ export const ES = ObjectAssign({}, ES2020, {
let resultString = `${year}-${month}`;
const calendar = GetSlot(yearMonth, CALENDAR);
const calendarID = ES.ToString(calendar);
if (calendarID !== 'iso8601') {
if (showCalendar === 'always' || calendarID !== 'iso8601') {
const day = ES.ISODateTimePartString(GetSlot(yearMonth, ISO_DAY));
resultString += `-${day}`;
}
Expand Down

0 comments on commit b79de07

Please sign in to comment.