Skip to content
Snippets Groups Projects

Allow changing past start dates of roles in webui

Merged Andreas Ellewsen requested to merge bugfix/past-start-dates-okay into master
1 file
+ 1
4
Compare changes
  • Side-by-side
  • Inline
@@ -77,10 +77,7 @@ export default function GuestRoleInfo({ guest }: GuestRoleInfoProps) {
const submit: SubmitHandler<RoleFormData> = (data) => {
const payload: { start_date?: string; end_date: string } = {
end_date: format(data.end_date as Date, 'yyyy-MM-dd'),
}
// Ignore start dates before today ()
if (data.start_date >= today) {
payload.start_date = format(data.start_date as Date, 'yyyy-MM-dd')
start_date: format(data.start_date as Date, 'yyyy-MM-dd'),
}
console.log('submitting', JSON.stringify(payload))
Loading