Skip to content
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

Minus sign at the beginning is applied only to the first unit in composite input #104

Open
MoonlightCapital opened this issue Jan 19, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@MoonlightCapital
Copy link

🐞 Description

Starting a composite duration with a minus sign will only treat the first block as negative.

Example:
1h30m => 5400000 CORRECT
-1h30m => -1800000 WRONG: This translates to -30 minutes
-1h30m => -5400000 CORRECT but weird

💡 Expected Behavior

The entire duration is set to negative, so for example, having -1h30m should return -5400000. This is currently achieved with -1h-30m, which is very weird.

↩️ Is This a Regression?

No.

🔬 Minimal Reproduction

Steps to reproduce the behavior:

  1. Use a composite duration that begins with a minus sign, but with no subsequent minus signs afterwards.

🔥 Error or Exception

If there's an error or an exception, please share it below:

None.

🌍 Environment

Describe your relevant environment (device, OS, browser, Node.js, packages, etc.):

Node v14.15.4
NPM 6.14.10
Windows 10 64bit
@standards/duration: 1.1.3

🖼️ Screenshots

roleduration

💬 Anything Else?

None.

@MoonlightCapital MoonlightCapital added the bug Something isn't working label Jan 19, 2021
@richrdkng richrdkng self-assigned this Jan 23, 2021
@richrdkng richrdkng pinned this issue Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants