Skip to content

Commit

Permalink
Issue #498 - Fix blackout dates on movie datepicker (#512)
Browse files Browse the repository at this point in the history
* Issue #498 - Update MovieManagerUI.js

Datepicker for advanced movie options blocks out dates that it shouldn't.

'maxDate' option defaults to null.
reference: https://flatpickr.js.org/options/

The option has been removed from flatpickr instance. This allows user to select future dates.

* #498 - Update MovieManagerUI.js

#512 PR review suggested further changes.

doOpen handler is entirely removed
  • Loading branch information
raptor-07 authored Dec 14, 2023
1 parent 708afce commit 9bf86ec
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions resources/js/Media/MovieManagerUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,19 +422,11 @@ var MovieManagerUI = MediaManagerUI.extend(
//Movie Generation time pickers
$('#movie-start-date').flatpickr({
allowInput: true,
dateFormat: 'Y/m/d',
onOpen: function (selected, str, instance) {
var observationDate = new Date(Helioviewer.userSettings.get("state.date"));
instance.set('maxDate', observationDate.toUTCDateString());
}
dateFormat: 'Y/m/d'
});
$('#movie-end-date').flatpickr({
allowInput: true,
dateFormat: 'Y/m/d',
onOpen: function (selected, str, instance) {
var observationDate = new Date(Helioviewer.userSettings.get("state.date"));
instance.set('minDate', observationDate.toUTCDateString());
}
dateFormat: 'Y/m/d'
});
if ($('#movie-start-date').length > 0) {
$('#movie-start-date')[0]._flatpickr.setDate(new Date(Helioviewer.userSettings.get("state.date") - duration).toUTCDateString());
Expand Down Expand Up @@ -1157,4 +1149,4 @@ var MovieManagerUI = MediaManagerUI.extend(
}
});

export { MovieManagerUI }
export { MovieManagerUI }

0 comments on commit 9bf86ec

Please sign in to comment.