tc39 / proposal-intl-duration-format

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

Editorial: PartitionDurationFormatPattern accessing non-existent slots #191

Closed ben-allen closed 6 months ago

ben-allen commented 7 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 7 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 6 months ago

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