-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Beyond 3DP seconds causes incorrect format output #96
Comments
It's not really within the scope of the project, moment-parseFormat is meant to parse date/time strings entered by humans. Something like new Date('2019-05-25T15:30:42.52605+00:00') |
A point. However, it shouldn't be very hard to fix - my regex skills are not the sharpest but it looks as though it would be possible to change the regex to include any number of fractional seconds. Though I think that >6 would fail in MomentJS. Also you do already support the same format to 3dp. The worst thing is that there is no warning so people entering longer strings may suddenly get an incorrect date/time output and may never realise. |
I can’t tell from looking at it how complex it would be. Each feature we’d add would need to be supported until the end of time, and I certainly won’t need it myself. I suggest you or someone else sends a pull request to see how much added complexity would be required to add support for it, then we can make a decision |
This is still occurring and becoming more of an issue as more systems support 64bit data and more systems support micro- and nano-second data. I have a partial work-around in node-red-contrib-uibuilder but it doesn't catch every case:
That is missing some data that has a At the very least, it would be much better to at least return a warning because this issue can result in an incorrect date being returned. |
I do agree @TotallyInformation. Node |
The following code:
Produces the following output:
As you can see, anything beyond 3DP on the seconds value results in "D" specifications on the end of the fractional seconds which is clearly incorrect and produces uncertain output from moment.
Reported to me in the following issue:
TotallyInformation/node-red-contrib-moment#24
The text was updated successfully, but these errors were encountered: