Skip to content
Snippets Groups Projects

Change rules for role dates

Merged Andreas Ellewsen requested to merge GREG-148-validate-role-dates into master
All threads resolved!
6 files
+ 30
60
Compare changes
  • Side-by-side
  • Inline
Files
6
  • 65338b15
    Change rules for role dates · 65338b15
    Andreas Ellewsen authored
    Dates can now be changed after they have started and ended. This means
    that there is no situation which needs disabling the input fields, and
    disabling has been removed.
    
    Start and end date can now be in the past. The following rules apply:
     - Start dates can be any date in the past, and no more into the future
       than the max days property of the role type.
     - End dates follow the same rules
     - End dates must be equal to or later than start date.
    
    Notification publishing has been reviewed to ensure duplicate
    notifications are not created when start or end date is today.
    
    Resolve: GREG-148
@@ -138,10 +138,8 @@ export default function GuestRoleInfo({ guest }: GuestRoleInfoProps) {
render={({ field: { onChange, value } }) => (
<DatePicker
mask="____-__-__"
disabled={roleInfo.start_date <= today}
label={t('input.roleStartDate')}
value={value}
minDate={today}
maxDate={todayPlusMaxDays}
inputFormat="yyyy-MM-dd"
onChange={onChange}
@@ -159,8 +157,6 @@ export default function GuestRoleInfo({ guest }: GuestRoleInfoProps) {
<DatePicker
mask="____-__-__"
label={t('input.roleEndDate')}
disabled={roleInfo.end_date < today}
minDate={today}
maxDate={todayPlusMaxDays}
value={value}
inputFormat="yyyy-MM-dd"
Loading