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

moment.duration.format error with zero-value tokens and significant digits on HTC mobile browser #96

Closed
jsmreese opened this issue Jan 16, 2018 · 2 comments
Labels

Comments

@jsmreese
Copy link
Owner

When using significant digits and moment.duration.format, tokens that have zero value are rendered as 0.0 instead of 0.

This occurs on the HTC One emulator on BrowserStack, Android 4.4. I've not yet tested on an actual HTC device.

@jsmreese jsmreese added the bug label Jan 17, 2018
@jsmreese
Copy link
Owner Author

jsmreese commented Jan 19, 2018

Verified that issue is present on a physical HTC One device.

@jsmreese
Copy link
Owner Author

jsmreese commented Jan 19, 2018

equal(moment.duration(10, "seconds").format("h[h] m[m] s[s]",
{
    useSignificantDigits: true,
    trim: false
}), "0h 0m 10s"); // Passes on HTC One
equal(moment.duration(10, "seconds").format("h[h] m[m] s[s]",
{
    useSignificantDigits: true,
    precision: 4,
    trim: false
}), "0h 0m 10s"); // Fails on HTC One

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant