nazar-pc / PickMeUp

Really simple, powerful, customizable and lightweight standalone datepicker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pickmeup isn't read the date passed as objects?

majioa opened this issue · comments

I have the code, which I add some hours to the current date in:

   date = new Date();
   date.setTime(date.getTime() + 3 * 60 * 60 * 1000);
   current = new Date();
   current.setTime(current.getTime() + 4 * 60 * 60 * 1000);
   pickmeup('#calendar', {
      date: date, // plus 3 hours
      current: current // plus 4 hours
   }).show();

In a debugger I see that the dates are being changed, but the dates on the calendary are the same (defaulting to now). So why the pickmeup isn't read the date passed as objects?

Why shouldn't dates be the same? PickMeUp doesn't care about hours, only about days, months and years. Also hours will not be preserved internally, so do not rely on that.

To be honest, I don't understand what you're trying to achieve and what issue you're facing.

@nazar-pc Of course PickMeUp doesn't care about hours, but when a date was passed to date field as an argument the lib just ignore the whole datetime with a date part defaulting to Date.now .