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

e parsing should read exactly one digit #6116

Open
Acumane opened this issue Apr 11, 2023 · 1 comment
Open

e parsing should read exactly one digit #6116

Acumane opened this issue Apr 11, 2023 · 1 comment
Labels

Comments

@Acumane
Copy link

Acumane commented Apr 11, 2023

Describe the bug
.format('eHHmm') returns an expected time string that moment validates as incorrect.

To Reproduce
Steps to reproduce the behavior:

  1. Moment.tz('America/New_York').format('eHHmm') produces, say, 21530
  2. But Moment('21530', 'eHHmm').isValid() returns false

Expected behavior
These two results should be (at least intuitively) consistent

Desktop (please complete the following information):

  • OS: Windows 11 WSL2
  • Browser: Chromium
  • Version: 112.0.5615.49 (Official Build) (64-bit)

Moment-specific environment

  • Vite 4.2.1 w/ Vue 3.2.47 running Node v18.12.1
  • Currently running on EDT

Please run the following code in your environment and include the output:

Tue Apr 11 2023 02:55:49 GMT-0400 (Eastern Daylight Time)
4/11/2023, 2:55:49 AM
240
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
2.29.4

Additional context
Moment('2-1530', 'e-HHmm') with any separator is, however, valid.

@Acumane Acumane changed the title Inconsistent behavior with Inconsistent behavior when formatting 'eHHmm' Apr 11, 2023
@ichernev
Copy link
Contributor

Yeah, e reads any number of digits instead of exactly one. You can submit a PR.

@ichernev ichernev changed the title Inconsistent behavior when formatting 'eHHmm' e parsing should read exactly one digit Dec 27, 2023
@ichernev ichernev added the Bug label Dec 27, 2023
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

2 participants