LP1816475: form validation prevents users from making reservations in the past collab/sandbergja/lp1816475_booking_followup
authorJane Sandberg <sandbej@linnbenton.edu>
Mon, 14 Oct 2019 21:47:49 +0000 (14:47 -0700)
committerJane Sandberg <sandbej@linnbenton.edu>
Mon, 14 Oct 2019 21:47:49 +0000 (14:47 -0700)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts

index 9e55db0..de821a1 100644 (file)
@@ -11,6 +11,7 @@ import {NetService} from '@eg/core/net.service';
 import {OrgService} from '@eg/core/org.service';
 import {PcrudService} from '@eg/core/pcrud.service';
 import {DialogComponent} from '@eg/share/dialog/dialog.component';
+import {notBeforeMomentValidator} from '@eg/share/validators/not_before_moment_validator.directive';
 import {PatronBarcodeValidator} from '@eg/share/validators/patron_barcode_validator.directive';
 import {ToastService} from '@eg/share/toast/toast.service';
 import {AlertDialogComponent} from '@eg/share/dialog/alert.component';
@@ -79,7 +80,7 @@ export class CreateReservationDialogComponent
                 [this.pbv.validate]
             ),
             'emailNotify': new FormControl(true),
-            'startTime': new FormControl(),
+            'startTime': new FormControl(null, notBeforeMomentValidator(Moment().add('15', 'minutes'))),
             'endTime': new FormControl(),
             'resourceList': new FormControl(),
         }, [startTimeIsBeforeEndTimeValidator]