trentrichardson / Intimidatetime

Intimidatetime is a wicked awesome date time picker for both jQuery and Zepto.
MIT License
17 stars 8 forks source link

can't set default date #4

Open scien opened 10 years ago

scien commented 10 years ago

https://github.com/trentrichardson/Intimidatetime/blob/master/src/Intimidatetime.js#L1228

typeof new Date() == 'object'

had to add another condition checking for !isNaN(Date.parse(o2[p]))

trentrichardson commented 10 years ago

Hey @scien

So that entire line now looks like:

o1[p] = (o1[p] === undefined || typeof o2[p] !== 'object' || $.isArray(o2[p]) || !isNaN(Date.parse(o2[p]))) ? o2[p] : mrec(o1[p], o2[p]);
trentrichardson commented 10 years ago

@scien have a look at the dev branch, that function has changed a lot there. It may fix your needs?..

https://github.com/trentrichardson/Intimidatetime/blob/dev/src/Intimidatetime.js#L1305

(This may also be the fix for your other issue) https://github.com/trentrichardson/Intimidatetime/issues/3

Sorry it completely slipped my mind I had updated that function in dev...