ng2-datetime icon indicating copy to clipboard operation
ng2-datetime copied to clipboard

Cannot read property 'getHours' of null

Open jj-apps opened this issue 9 years ago • 1 comments

When I set the ngModel variable (request.needByDateTime) to null from an event on another part of the form, I get a "getHours" error from the time picker.

My date/timepicker

<datetime [datepicker]="_datepickerOptions" [timepicker]="_timepickerOptions" [(ngModel)]="request.needByDateTime" formControlName="needByDateTime"></datetime>

My Date/time options private _datepickerOptions = { autoclose: true, icon: 'fa fa-calendar' }

private _timepickerOptions = { explicitMode: true, defaultTime: 'current', icon: 'fa fa-clock-o' }

Error:

TypeError: Cannot read property 'getHours' of null
    at NKDatetime.updateModel (ng2-datetime.ts:201)
    at eval (ng2-datetime.ts:102)
    at ZoneDelegate.invokeTask (zone.js:356)
    at Object.onInvokeTask (ng_zone_impl.ts:61)
    at ZoneDelegate.invokeTask (zone.js:355)
    at Zone.runTask (zone.js:256)
    at ZoneTask.invoke (zone.js:423)

jj-apps avatar Aug 25 '16 00:08 jj-apps

Hi , I am trying to use the timepicker functionality of the datetime component.but timepicker bootstrap-timepicker-widget dropdown-menu timepicker widget i didn't get widget.may i know the problem. timpicker-widget timpicker-widget timpicker-widget

SATEESHLRR avatar May 11 '18 12:05 SATEESHLRR