-
Notifications
You must be signed in to change notification settings - Fork 120
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
choose which token to trim/show when value is 0 #22
Comments
That's a good use case. I can't think of a way to do it directly in this version, but a new |
I would love this as well! right now I'm having to do a case statement to ensure that the seconds token is always displayed |
Would you prefer to set an option:
Or would you prefer an addition to the format grammar:
I'm leaning towards an addition to the format grammar. It seems like it would be easier to use that way. |
|
I think i prefer the second version with the *.THanks |
Either the trimUntil or the * would work but the token is much more consumable in my opinion. You can store it on a single attribute for automated formatting and keep it simple where the settings object forces any consumer or code to be more complex. |
Another thing maybe unrelated but if you have mm I would expect the output to force length to 2 as opposed to a single m which would trim the leading 0s |
I've implemented the * functionality on my dev branch. Please give it a try if you get a chance! Also, @danatcofo: When the leading token has a length of one (as in If the template is |
Works for me, thank you! |
Thanks for adding this feature in to you dev branch! Works for me. |
I am trying to format ms into a "progress" time.
so what i would like is for
Is there already a way to do that?
(i dont think so)
On way would be to use format
h:m:ss
but with an "option" to trim h but not mm.I hope it make sense
The text was updated successfully, but these errors were encountered: