jonthornton / Datepair.js

A javascript plugin for intelligently selecting date and time ranges, inspired by Google Calendar.
https://www.jonthornton.com/Datepair.js
359 stars 85 forks source link

Get method #22

Closed danielsmacdonald closed 10 years ago

danielsmacdonald commented 10 years ago

Is there any reason there isn't a get method that allows you to get the start or end date combined with it's matching time?

Like: $("#container").datepair('getStart') returning a full timestamp of startdate+starttime.

It's not particularly hard to add but it feels like something that would be useful in almost every datepair use-case I can think of.

jonthornton commented 10 years ago

Yup, there's a reason. Datepair.js doesn't need to compute the full timestamp of startdate+starttime to accomplish its primary purpose of linking start+end inputs.

If the combined datetimes were already being computed internally it wouldn't be much trouble to expose them via a method call, but otherwise it doesn't make sense to add this functionality. Like you said, it's pretty easy to hand-code. moment.js is another good option.