Closed pksatish07 closed 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>
<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()); } );
You have to use moment.js since you are using date-format. Do you have that one in index.html?
Closing since there is no response. Please re-open if problem continues
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()); } );