jonthornton/Datepair.js

Easily getting the datestamps?

Closed this issue · 1 comments

Maybe I'm overlooking something (very likely), but I'd love to be able to:

  • quickly get the beginning and end datestamp
  • quickly set the beginning and end datestamp

Currently my code takes the date objects from both date.start and time.start, and then uses some messy math to find out the merged timestamp. This works. It's just that I half expected this project to do all this for me.

Again, I'm probably overlooking something.

No, you're correct that Datepair.js doesn't provide a way to get the merged date+time.

If you're using https://github.com/jonthornton/jquery-timepicker for the time selector, that library's getTime method can optionally take a date and combine the time with that date. So you could get the date from the datepicker and pass that into jquery-timepicker's getTime method, and that would remove the need for you to combine the dates yourself.