-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fractionalDigits, (||milli|micro|nano)secondsDisplay impact to number of fractional digits while style: "digital" #139
Comments
It's a bit late to make changes, but reasonable behavior could be to change the default millisecondStyle, microsecondStyle, and nanosecondStyle in style: "digital" to be "short" if the Display for that unit is "always". |
I think you didn't get my point. the issue is with style: "digital" (and some other cases that the fractional second units fold to be a higher unit because it is set to 'numeric'), any units below second is now part of second and never displayed by itself. (so the formatToParts will not have a unit with these unit when the style is digital) so how would the display for these units make sense when it is "always"? (since it cannot be "always" in that case) |
I thought we were allowing |
|
If we have { style: "digital", milliseconds: "short" } in the option, step 6-a-i of GetDurationUnitOptions will throw RangeError now because under the iterator of the table, when the GetDurationUnitOptions got called with "seconds" as unit, the return style will be set to "numeric" by step 3-a-ii
|
@FrankYFTang is correct, you cannot tweak the milliseconds style option to something that doesn't work for the overall style One option I feel works best is to allow only one of the |
|
you're right, syntax error from my side but basically this. Anything below seconds will be handled as a fraction in |
So... we have the following options in the object creation all seems connect to the formating result of the "second". While the style is not "digital", these options are not interacted with each other so it is easy to understand, however, I am not sure what is the current intended result when the style is "digital"
fractionalDigits: 0...9 (default 0)
secondsDisplay: 'auto' | 'always' (default auto)
millisecondsDisplay: 'auto' | 'always' (default auto)
microsecondsDisplay: 'auto' | 'always' (default auto)
nanosecondsDisplay: 'auto' | 'always' (default auto)
consider the following data
Looking from the current spec, it seems the only option decide the number of formatted fractional digits is solely controlled by fractionalDigits and the output is not impacted by the present of secondsDisplay, millisecondsDisplay, microsecondsDisplay or nanosecondsDisplay .
For example, if we have the following code
it seems the current spec text will output "9:01" instead of "9:01.003"
but is that what we like to see?
If we will ignore millisecondsDisplay, microsecondsDisplay and nanosecondsDisplay while the style is "digital", then should we throw in such condition during the constrcutor ?
If we will not ignore them, then what should we do if we also have the presence of fractionalDigits ?
@ryzokuken @sffc
The text was updated successfully, but these errors were encountered: