angular2-datetimepicker icon indicating copy to clipboard operation
angular2-datetimepicker copied to clipboard

Not working in safari browser Version 10.1.2 (12603.3.8)

Open Ganeshkharche opened this issue 6 years ago • 2 comments

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'

Ganeshkharche avatar Apr 27 '18 10:04 Ganeshkharche

same problem is in Firefox 59.0.2

pixyk avatar Jun 12 '18 13:06 pixyk

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. 😄

itaimoorali avatar Dec 17 '19 07:12 itaimoorali