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

Have TimelineConfig validate date parts as integers #269

Closed
JoeGermuska opened this issue Oct 6, 2015 · 4 comments
Closed

Have TimelineConfig validate date parts as integers #269

JoeGermuska opened this issue Oct 6, 2015 · 4 comments

Comments

@JoeGermuska
Copy link
Member

Someone filed a support ticket because she was using month names. Timeline was using parseInt and ended up treating them all as January.

We should verify that month, date, and year are integers and log an error otherwise.

@jywsn
Copy link
Contributor

jywsn commented Oct 9, 2015

Is this the problem?

https://github.com/NUKnightLab/TimelineJS3/blob/media-background/source/js/date/TL.Date.js#L115-L117

Basically, we should be distinguishing between an invalid input string and an empty input string?

@JoeGermuska
Copy link
Member Author

yeah, i think instead of isNaN it could be something like

var x = TL.Util.trim(_date[DATE_PARTS[ix]]);
if (!x.match(/^\d*$/)) { //error else parse it and store it

@jywsn
Copy link
Contributor

jywsn commented Oct 9, 2015

db4bcbc

@JoeGermuska
Copy link
Member Author

this was made live in 3.3.9 but the issue wasn't closed

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

No branches or pull requests

2 participants