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

detecting change of end fields #74

Closed turgs closed 8 years ago

turgs commented 8 years ago

Hello

Thank you for making this code available!

My usage is just like your jQuery Example on your demo page http://jonthornton.github.io/Datepair.js/

When a user changes the start_time field to be later or earlier, the datepair code automatically moves the end_time to preserve the original duration between the 2 times. Just what I want!!

However, I need to detect any changes to the start/end date/time fields to convert the format and populate hidden fields. I've found that when datepair automatically moves the date/time to preserve the original duration between the 2 times.... a change trigger isn't fired on the other field.. so I can't tell that this has occurred. Therefore, my hidden field contains a stale value.

I though listening to the event rangeSelected would solve my issue, however it seems this is fired prior to datepair automatically changed the end_time field.

Do you know what event I need to listen to in order to do what I need?

Cheers Tim

turgs commented 8 years ago

nevermind. user error