Skip to content
Snippets Groups Projects

When setting visit start date, end date is steup automatically for +3 months

Merged Piotr Gawron requested to merge 64-visit-add into master
4 files
+ 326
305
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 12
0
function visit_dates_begaviour(startDateInput, endDateInput) {
$(startDateInput).change(function () {
var object = $(this);
try {
var date = new Date(object.val());
date.setMonth(date.getMonth() + 3);
$(endDateInput).val(date.toISOString().substring(0, 10));
} catch (err) {
//there was a problematic date to process
}
});
}
Loading