jonthornton / Datepair.js

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

How set time end? #60

Closed jeffersongouveia closed 8 years ago

jeffersongouveia commented 8 years ago

Hello everyone, i set start time normally, but i need set time end too. Or set interval of 1 hour and display on input time end.

jonthornton commented 8 years ago

I'm sorry, I don't understand your question. Could you try to restate it?

jeffersongouveia commented 8 years ago

I have this line that defines the start time and works

$('#start_time').timepicker('setTime', date.format('hh:mm'));

So i did the same for the end time

$('#end_time').timepicker('setTime', end_time);

And it sets, but not the right way datepair

What I need? This datepair-two

jonthornton commented 8 years ago

You probably need to call Datepair's refresh() method after setting the end time. From the readme:

Call this method if you programmatically update the date/time fields after first initialization of datepair.