Exception:
ERROR TypeError: date.format is not a function
at NbMomentDateService.format (moment-date.service.js?7128:54)
at NbDateAdapterService.format (datepicker-adapter.js?5298:32)
at NbDatepickerDirective.writeInput (datepicker.directive.js?0efc:349)
at NbDatepickerDirective.writeValue (datepicker.directive.js?0efc:207)
at setUpControl (forms.js?8087:1645)
at FormGroupDirective.addControl (forms.js?8087:4454)
Expected behavior:
The datepicker should be initialized with moment() and value should be set when a date is selected
Steps to reproduce:
Add nb-datepicker with NbMomentDateModule
launch browser and view console
Select a date and retrieve the value in your component class
Related code:
insert short code snippets here
Other information:
npm, node, OS, Browser
<!--
Node, npm: `node --version` and `npm --version`
OS: Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)
Browser: Chrome/Safari/Firefox/etc?
-->
Angular, Nebular
<!--
Check your `package-lock.json` or locate a `package.json` in the `node_modules` folder.
-->
Issue type
I'm submitting a ... (check one with "x")
Issue description
nb-datepicker with NbMomentDateModule not working Current behavior:
I added nb-datepicker to the html page and also added NbMomentDateModule but when the page loads , I get an exception in the console.
<input class="form-control" nbInput placeholder="Birth Date" [nbDatepicker]="formcontrol" formControlName="birthDate"> <nb-datepicker #formcontrol>
Exception: ERROR TypeError: date.format is not a function at NbMomentDateService.format (moment-date.service.js?7128:54) at NbDateAdapterService.format (datepicker-adapter.js?5298:32) at NbDatepickerDirective.writeInput (datepicker.directive.js?0efc:349) at NbDatepickerDirective.writeValue (datepicker.directive.js?0efc:207) at setUpControl (forms.js?8087:1645) at FormGroupDirective.addControl (forms.js?8087:4454)
Expected behavior:
The datepicker should be initialized with moment() and value should be set when a date is selected Steps to reproduce:
Related code:
Other information:
npm, node, OS, Browser
Angular, Nebular