Closed thejaff2 closed 6 years ago
Could you point to the line of code that you refer to?
I think I used a MomentJS validation not long ago, is it something like the following that you are expecting?
before
if (isNaN(Date.parse(newValue)) && newValue !== null) {
after
if (moment(newValue, this._format, true).isValid() && newValue !== null) {
If you could give that a try, that would help me out.
sorry clicked the wrong button, not the first time lol
Yes, I've tried that (by editing the dist/amd-source directly) and it seems to work.
oh right I never thought of editing that AMD file, my process of testing that is a bit longer than that. I usually made the change in original file, build the plugin then finally copy & paste the dist
folder to the node_modules
folder in the demo.
This lib is all done through my spare time, which as most of us not that free, so I usually work on these during the weekend. I'm not sure if a new version will happen before the weekend. I would be glad if one of you can figure out the other open issue before I push a new version.
Thanks for all the feedback and help, I included the fix that you provided and pushed a new version 1.3.1
on NPM
Please confirm that it works
I can confirm that it works, good job!
Using Date.parse() in the modelChanged event handler is not optimal since it behaves differently in different browsers. For example:
Date.parse(new Date("0001-01-01"))
works in Chrome, but fails in Edge (returns NaN). Shouldn't moment be used for this checks as well?