Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarification on interactions between hourCycle and dayPeriod (#28109)
updated Intl.DateTimeFormat constructor to clarify that hourCycle: `h11` option will allow dayPeriod to be shown Previous wording implied that dayPeriod is only used if `(hourCycle: 'h12')` option is set, updated to reflect that `dayPeriod` is displayed if either `{hourCycle: 'h12'` or `(hourCycle: 'h11')` are set. See below: ```const date = new Date(Date.UTC(2020, 11, 20, 18, 23, 16, 738)); // Results below assume UTC timezone - your results may vary console.log(new Intl.DateTimeFormat('en-US', {hourCycle: 'h11', hour: '2-digit', dayPeriod: 'long'}).format(date)) console.log(new Intl.DateTimeFormat('en-US', {hourCycle: 'h12', hour: '2-digit', dayPeriod: 'long'}).format(date)) console.log(new Intl.DateTimeFormat('en-US', {hourCycle: 'h23', hour: '2-digit', dayPeriod: 'long'}).format(date)) console.log(new Intl.DateTimeFormat('en-US', {hourCycle: 'h24', hour: '2-digit', dayPeriod: 'long'}).format(date)) // output: // > "10 in the morning" // > "10 in the morning" // > "10" // > "10"```
- Loading branch information