From 8389e06a5a6846ca4e023e729a1350184b126471 Mon Sep 17 00:00:00 2001 From: sandeep3005 Date: Wed, 28 Nov 2018 12:28:26 +0530 Subject: [PATCH] Solve issue for Mozilla and Safari --- src/app/angular2-datetimepicker/datepicker.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/angular2-datetimepicker/datepicker.component.ts b/src/app/angular2-datetimepicker/datepicker.component.ts index bddc3db..91101f9 100644 --- a/src/app/angular2-datetimepicker/datepicker.component.ts +++ b/src/app/angular2-datetimepicker/datepicker.component.ts @@ -188,7 +188,7 @@ export class DatePicker implements OnInit, ControlValueAccessor { } day++; } - dateRow.push({ day: dateCell, date: new Date((month + 1) + '-' + dateCell + '-' + date.getFullYear()) }); + dateRow.push({ day: dateCell, date: new Date((month + 1) + '/' + dateCell + '/' + date.getFullYear()) }); } // stop making rows if we've run out of days if (day > monthLength) { @@ -199,7 +199,6 @@ export class DatePicker implements OnInit, ControlValueAccessor { } } return dateArr; - } generateYearList(param: string) { this.clickedToChangeYear = true; @@ -461,7 +460,7 @@ export class DatePicker implements OnInit, ControlValueAccessor { this.popover = false; } composeDate(date: Date) { - return (date.getMonth() + 1) + '-' + date.getDate() + '-' + date.getFullYear(); + return (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear(); } getCurrentWeek() { var curr_date = new Date();