ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

Issue with date in IE #151

Closed pksatish07 closed 7 years ago

pksatish07 commented 7 years ago

Hi I am getting different date in IE (Version 11) and chrome.

Date selected : 26-02-2017

Chrome Sun Feb 26 2017 22:04:00 GMT+0530 IE Sat Mar 02 2019 22:04:00 GMT+0530 (India Standard Time)

As you can clearly see the date that IE gave is wrong.

Below are the code snippets <div class="col-sm-8"> <input class="form-control" [(ngModel)]="fixRTWDate" ng2-datetime-picker date-format="DD-MM-YYYY HH:mm" close-on-select="false" formControlName="FixRTWdate" [min-date]="fixRtwMinDate" [max-date]="fixRtwMaxDate" /> </div>

this.newTicketForm.controls['FixRTWdate'].valueChanges.subscribe( (value: any) => { this.rtwDate = new Date(value); console.log(this.rtwDate.toString()); } );

allenhwkim commented 7 years ago

You have to use moment.js since you are using date-format. Do you have that one in index.html?

allenhwkim commented 7 years ago

Closing since there is no response. Please re-open if problem continues