</button>
</div>
</div>
- <eg-datetime-select [initialIso]="dueDate"
+ <eg-datetime-select [initialIso]="dueDate" [noPast]="true"
[readOnly]="dueDateOptions === 0" (onChangeAsIso)="setDueDate($event)">
</eg-datetime-select>
+ <ng-container *ngIf="dueDateInvalid">
+ <span class="text-danger font-weight-bold ml-2" i18n>Due Date is Invalid</span>
+ </ng-container>
</div>
</div>
cellTextGenerator: GridCellTextGenerator;
dueDate: string;
dueDateOptions: 0 | 1 | 2 = 0; // auto date; specific date; session date
+ dueDateInvalid = false;
printOnComplete = true;
strictBarcode = false;
checkout(params?: CheckoutParams, override?: boolean): Promise<CheckoutResult> {
+ if (this.dueDateInvalid) {
+ return Promise.resolve(null);
+ }
+
let barcode;
const promise = params ? Promise.resolve(params) : this.collectParams();
}
setDueDate(iso: string) {
+ const date = new Date(Date.parse(iso));
+ this.dueDateInvalid = (date < new Date());
this.dueDate = iso;
this.store.setSessionItem('eg.circ.checkout.due_date', this.dueDate);
}