Skip to content

Commit

Permalink
Set default date when creating unavailabilities
Browse files Browse the repository at this point in the history
System should reject unavailabilities created without a default date,
otherwise makes them recur all the time
  • Loading branch information
PencilAmazing committed Jan 14, 2025
1 parent db9767b commit 20cd072
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/javascript/entrypoints/admin_availability_calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,11 @@ const openModal = (arg) => {
// Set default visibility based on whether the event is recurring or whole day
if (arg !== undefined && arg !== null) {
startTimePicker.setDate(Date.parse(arg.startStr));
//startDatePicker.setDate(Date.parse(arg.startStr));
startDatePicker.clear();
startDatePicker.setDate(Date.parse(arg.startStr));
//startDatePicker.clear();
endTimePicker.setDate(Date.parse(arg.endStr));
//endDatePicker.setDate(Date.parse(arg.endStr));
endDatePicker.clear();
endDatePicker.setDate(Date.parse(arg.endStr));
//endDatePicker.clear();
dayInput.value = new Date(Date.parse(arg.startStr)).getDay();
wholeDayCheckbox.checked =
new Date(Date.parse(arg.endStr)).getHours() === 23 &&
Expand Down

0 comments on commit 20cd072

Please sign in to comment.