Skip to content

Commit

Permalink
Fix problem with the end date still being visible when multi-day book…
Browse files Browse the repository at this point in the history
…ings are not allowed.
  • Loading branch information
campbell-m committed Aug 18, 2023
1 parent a9a6f78 commit ba0fb78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions web/css/mrbs.css.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
box-sizing: border-box;
}

.hidden_field {
visibility: hidden;
}

<?php
// <input> elements of type 'date' are converted by the JavaScript into datepickers.
// In order to prevent the display shifting about during the conversion process we set
Expand Down
8 changes: 4 additions & 4 deletions web/edit_entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,14 @@ function get_field_end_time(int $value, bool $disabled=false) : FieldDiv
'value' => $end_date,
'aria-label' => $label,
'disabled' => $disabled,
'required' => true)
);
'required' => true
));

// Don't show the end date if multiday bookings are not allowed
if (!$multiday_allowed)
{
$element_date->setAttributes(array('style' => 'visibility: hidden',
'disabled' => true));
$element_date->setAttribute('disabled', true)
->addClass('hidden_field');
}

$a = $areas[$area_id];
Expand Down

0 comments on commit ba0fb78

Please sign in to comment.