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

Times not syncing correctly #113

Closed KrunchMuffin closed 5 years ago

KrunchMuffin commented 5 years ago

Fiddle http://jsfiddle.net/6at417bv/

  1. Open modal
  2. Select 7:00 AM [end time is +4hrs 11:00 AM perfect]
  3. Change end time to 12:00 PM [Works. great.]
  4. Change start time to 6:00 AM [Not great. end time changes to 11:00 AM. Why? It's not 4 hrs, even if it was, it shouldn't change it if both times are already set. My users are getting frustrated.]
  5. Change it back to 7:00 AM [end time goes to 12:00 PM that's 5 hrs, but again, it shouldn't change]

Hope this makes sense.

PradeepSinghMakwana commented 5 years ago

Yes, it happens only when anchor is set to start time. By default the anchor is always set to start time. However, you can easily change it to end time or null(in case you don't want the anchor). Check the end of this page...

Official DatePair.js

It contains, how to use Anchor example.