From 4de4c93723f905c10715e23bc85f3747a2a271c2 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Mon, 8 Apr 2019 12:58:46 -0700 Subject: [PATCH] LP1816475: Fixing default dates for fmeditor Signed-off-by: Jane Sandberg --- .../src/app/staff/booking/create-reservation.component.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts index 7623665d9e..c3f821ff13 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts @@ -270,9 +270,16 @@ export class CreateReservationComponent implements OnInit, AfterViewInit { rows[rows.length - 1]['time'], this.format.wsOrgTimezone).clone() .add(this.granularity, 'minutes'); } else { - this.defaultTimes['start_time'] = Moment.tz(rows[0]['time'], 'LT', this.format.wsOrgTimezone); - this.defaultTimes['end_time'] = - Moment.tz(rows[rows.length - 1]['time'], 'LT', this.format.wsOrgTimezone).add(this.granularity, 'minutes'); + this.defaultTimes['start_time'] = Moment.tz('' + + this.idealDate.getFullYear() + '-' + + (this.idealDate.getMonth() + 1) + '-' + + (this.idealDate.getDate()) + ' ' + rows[0]['time'], + 'YYYY-MM-DD LT', this.format.wsOrgTimezone); + this.defaultTimes['end_time'] = Moment.tz('' + + this.idealDate.getFullYear() + '-' + + (this.idealDate.getMonth() + 1) + '-' + + (this.idealDate.getDate()) + ' ' + rows[rows.length - 1]['time'], + 'YYYY-MM-DD LT', this.format.wsOrgTimezone).clone().add(this.granularity, 'minutes'); } } else { if (this.multiday) { this.defaultTimes['end_time'] = this.defaultTimes['start_time'].clone().add(1, 'days'); } -- 2.11.0