From 9b26fa924578db1220721793c2e3590edfdc944e Mon Sep 17 00:00:00 2001
From: Jane Sandberg <sandbej@linnbenton.edu>
Date: Mon, 14 Oct 2019 14:47:49 -0700
Subject: [PATCH] LP1816475: form validation prevents users from making
 reservations in the past

Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
---
 .../eg2/src/app/staff/booking/create-reservation-dialog.component.ts   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts
index 82a14bfdbe..0ef212b1a6 100644
--- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts
@@ -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]
-- 
2.11.0