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

Check for leap years or short months when giving a custom date format #159

Closed
UnicodingUnicorn opened this issue Oct 31, 2019 · 1 comment · Fixed by #170
Closed

Check for leap years or short months when giving a custom date format #159

UnicodingUnicorn opened this issue Oct 31, 2019 · 1 comment · Fixed by #170

Comments

@UnicodingUnicorn
Copy link
Contributor

This is technically a continuation of #114. Pull request #158 resolves this when using 'default' but does not change the behaviour of custom specified formats.

The problem lies with the format parser, d3-time-format, passes dates directly to a JavaScript Date object which glosses over such things. The pull request solves it by directly parsing the supplied date with moment.js, which does perform such error checking.

Since the format strings of d3-time-format do not have a one-to-one mapping to the format strings of moment.js, solving this issue is not a simple method of putting in a regex replace. The format strings are also required by the spec.

I believe that either the issue needs a fix from the upstream dependency (i.e. d3/d3-time-format#47), or for tableschema-js to switch to a different dependency. I'm opening this issue as more of a documentation thing.


Please preserve this line to notify @roll (lead of this repository)

@roll
Copy link
Member

roll commented Oct 31, 2019

@UnicodingUnicorn
Thanks for creating the issue!

For now, we only can consider it as a limitation of underlying libraries.

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

Successfully merging a pull request may close this issue.

2 participants