If you set a defaultTimeDelta to null for example then load a form with a time defined for both fields, start and end.
If you set an anchor to start.
Then each time you modify the start field it'll add 3 hours to the end one.
defaultTimeDelta is not used in this case.
It works only if end date field is empty.
So I modified your code like this to have the defaultTimeDelta value used in all cases.
_timeChanged: function(target){
if (!this.startTimeInput || !this.endTimeInput) {
return;
}
var startTime = this.settings.parseTime(this.startTimeInput);
var endTime = this.settings.parseTime(this.endTimeInput);
// Added those lines to have defaultTimeDelta really functionnal
if (this.settings.defaultTimeDelta !== null) {
this.timeDelta = this.settings.defaultTimeDelta;
} else {
this.timeDelta = null;
}
if (!startTime || !endTime) {
etc.
May be you will have a better solution, but it's works for me like this.
Pretty sure it's the same for DefaultDateDelta ... but I do not use it right now ;)
Hello,
If you set a defaultTimeDelta to null for example then load a form with a time defined for both fields, start and end. If you set an anchor to start.
Then each time you modify the start field it'll add 3 hours to the end one.
defaultTimeDelta is not used in this case.
It works only if end date field is empty.
So I modified your code like this to have the defaultTimeDelta value used in all cases.
May be you will have a better solution, but it's works for me like this. Pretty sure it's the same for DefaultDateDelta ... but I do not use it right now ;)
Regards, Hervé