nazar-pc / PickMeUp

Really simple, powerful, customizable and lightweight standalone datepicker
BSD Zero Clause License
616 stars 191 forks source link

Nan Dates in Firefox #196

Closed JasonDimmick closed 6 years ago

JasonDimmick commented 6 years ago

pickmeup('.date').get_date(true) returning - Nan-Nan-Na Calendar loading with Nan for all dates.

nazar-pc commented 6 years ago

I don't see this behavior in Firefox Nightly, can you prepare a demo (https://github.com/nazar-pc/PickMeUp#contribution)?

JasonDimmick commented 6 years ago

The issue seems to be more with Firefox and what it accepts as dates. The set_date function must be set with a date that has been created with the Date(year, month, day) format. IE and Chrome are more forgiving. Also, if you use a format with the control other than y-m-d the value returned by get_date() cannot be cast or used to create a Date object later.

BTW, great job! This is a very useful tool.

nazar-pc commented 6 years ago

You can call get_date(false) and get Date object if needed.

set_date accepts either proper Date object or date in the configured format, just like returned by get_date(true). If this doesn't behave as advertised, please prepare a demo and I'll fix it.