Skip to content

Formatting of negative durations #1699

Closed Answered by diesieben07
chrishens asked this question in Q&A
Discussion options

You must be logged in to vote

After further consideration I have decided not to enable this behavior by default.
Instead the next version will have a parameter to toFormat to enable this new behavior:

Duration.fromObject({ hours: -1.5 }).toFormat("hh:mm", { signMode: "negativeLargestOnly" }): // => -01:30

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@chrishens
Comment options

@diesieben07
Comment options

@chrishens
Comment options

@diesieben07
Comment options

@dobon
Comment options

Comment options

You must be logged in to vote
4 replies
@shaedrich
Comment options

@diesieben07
Comment options

@shaedrich
Comment options

@diesieben07
Comment options

Answer selected by diesieben07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants