An API to expose information of locale, such as week data ( first day of a week, weekend start, weekend end), hour cycle, measurement system, commonly used calendar, etc.
MIT License
56
stars
11
forks
source link
WeekInfoOfLocale need to convert loc.[[FirstDayOfWeek]] to number before return #82
Hey @FrankYFTang - While implementing this, I came across a small issue. I think WeekInfoOfLocale needs to be updated to match the [[FirstDayOfWeek]] changes. [[FirstDayOfWeek]] can now be an arbitrary string, but steps 4-5 of WeekInfoOfLocale state:
4. Let fw be loc.[[FirstDayOfWeek]].
5. If fw is not undefined, then
a. Set r.[[FirstDay]] to fw.
Where r.[[FirstDay]] is an "Integer value between 1 and 7". So I think there needs to be a step to convert fw from a string to an integer here.
This is reported by @trflynn89 in https://github.com/tc39/proposal-intl-locale-info/pull/79 I copy his report below:
Hey @FrankYFTang - While implementing this, I came across a small issue. I think
WeekInfoOfLocale
needs to be updated to match the[[FirstDayOfWeek]]
changes.[[FirstDayOfWeek]]
can now be an arbitrary string, but steps 4-5 ofWeekInfoOfLocale
state:Where
r.[[FirstDay]]
is an "Integer value between 1 and 7". So I think there needs to be a step to convertfw
from a string to an integer here.