tc39 / proposal-intl-duration-format

https://tc39.es/proposal-intl-duration-format
MIT License
163 stars 18 forks source link

Editorial: PartitionDurationFormatPattern accessing non-existent slots #191

Closed ben-allen closed 3 months ago

ben-allen commented 4 months ago

fix https://github.com/tc39/proposal-intl-duration-format/issues/190: PartitionDurationFormatPattern incorrectly tried to draw value of hours and seconds from DurationFormat object rather than from Duration Record.

FrankYFTang commented 4 months ago

This PR will solve the accessing non-existent slots issue. However, it is not solving the output problem completely. Consider the following input

{"hours":1,"minutes":0,"seconds":0,"milliseconds":1}
{"hours":1,"minutes":0,"seconds":0,"microseconds":1}
{"hours":1,"minutes":0,"seconds":0,"nanoseconds":1}

The output in the algorithm will not set displayRequired to true because duration.[[Seconds]] is 0.

ben-allen commented 3 months ago

marking this one as closed, since #188 fixed both: