AmirkabirDataMiners / ADM-dateTimePicker

Pure AngularJs dateTimePicker
http://amirkabirdataminers.github.io/ADM-dateTimePicker
MIT License
244 stars 92 forks source link

Typing Date in Input sets wrong date on Firefox #70

Open irackley-mc opened 7 years ago

irackley-mc commented 7 years ago

When typing in a date manually on Firefox, the date is set to 1 day before your input. For example, if you type 1-14-14 as mm-dd-yy for the datepicker, it is updated to 1-13-14 on blur.

This did not happen in the 1.0 version and is due to a bug with new date creation on Firefox vs Chrome.

MeTe-30 commented 7 years ago

Are you sure? I test what you said in this Plunker But didn't see any problem!

irackley-mc commented 7 years ago

Just did some additional testing and it looks like it is reproducible for any timezone before/left of GMT. This can be tested by setting the system clock on your PC to a timezone such as Eastern Standard Time, (UTC-5) and then reopening Firefox and using the datepicker. You might have to fully close and then reopen Firefox for the timezone change to go into effect.

I also think an easy fix so far is simply replacing the hyphen '-' in dtp_toDate with a forward slash '/', but it'll require some additional testing. For some reason firefox treats those 2 different and only cares about the timezone for one of those instances.