angular2-datetimepicker
angular2-datetimepicker copied to clipboard
Not working in safari browser Version 10.1.2 (12603.3.8)
This is working fine when i add new date but in edit case its not supporting either it would be correct date format issue. Here is my code In Component.ts file model:any={}; settings = { timePicker: true, format: 'dd-MM-yyyy THH:mm:ss.sss', OR format: 'dd-MM-yyyy hh : mm a', defaultOpen: false } DatePicker.prototype.ngOnInit = function() { this.settings = Object.assign(this.defaultSettings, this.settings); if (this.settings.defaultOpen) { this.popover = true; } else { this.date = new Date(); } };
this.model.date = data.result.date; OR this.model.date = new Date(data.result.date); Both are not working
In component.html <angular2-date-picker name="date" [(ngModel)]="model.date" [settings]="settings" #date=ngModel>
Error Error: InvalidPipeArgument: 'Invalid Date' for pipe 'DatePipe'
same problem is in Firefox 59.0.2
I manage to fix this issue. At this line in the source code, its creating a date. Unfortunately this date format is not supported by safari. So if you change the dashes to slash "/" and another place then it will behave as expected. 😄