Skip to content

Instantly share code, notes, and snippets.

@tpaksu
Created November 20, 2020 08:25
Show Gist options
  • Save tpaksu/a00ebe1c54e829f8552bbf550928f6ff to your computer and use it in GitHub Desktop.
Save tpaksu/a00ebe1c54e829f8552bbf550928f6ff to your computer and use it in GitHub Desktop.
// replace your start date instance onfirstselect event with this:
onfirstselect: function (instance, start) {
startDate = start.clone();
startInstance.globals.startSelected = false;
startInstance.hideDropdown();
endInstance.showDropdown();
endInstance.setDisplayDate(start.clone());
endInstance.config.minDate = startDate.clone();
endInstance.config.startDate = startDate.clone();
endInstance.config.endDate = null;
endInstance.globals.startSelected = true;
endInstance.globals.endSelected = false;
endInstance.globals.firstValueSelected = true;
if (endDate && startDate.isAfter(endDate)) {
[startDate, endDate] = [endDate, startDate];
endInstance.config.endDate = endDate.clone();
}
fillInputs();
endInstance.updateHeader();
endInstance.reDrawCells();
endInstance.updateTimePickerDisplay();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment