As the timestamp recently turns over 1.5 billions, a strange (and apparently random) bug arises in one of my script.
I got to initialize a dateTimePicker, I did this :
$('#datepickerfield').data('DateTimePicker').date(new Date(1502173800000));
1502173800000 is of course a millisecond timestamp. Most of the time, it just works.
But as you can see, somehow 15021738... could be (and in fact, sometime, IS) wrongly interpreted as 15/02/1738 (french dd/mm/yyyy format)... That was not the case with timestamps beginning with 1499 or even 1500 and the bug just appears at the moment timestamps start to begin with 1501 (leads to january, the 15th) and so on.
It does appear RANDOMLY which is very annoying and almost impossible to fix on the server side (too many cases to consider, even a date like 15/02/1738 could be legit in some contexts)
So i got two questions :
- has anyone ever experienced that ? Is this a know javascript bug (i've searched but did not found any complaint on this matter.)
- how could i replace this call by a better one ? I'm using Angular v1.5, Moment.js, JQuery 2.x - this precise call is in an Angular controller.
Thanks for your attention
Denis