nb-datepicker with NbMomentDateModule not working
See original GitHub issueIssue type
I’m submitting a … (check one with “x”)
- bug report
- feature request
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></nb-datepicker>
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 Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:9 (1 by maintainers)
Top GitHub Comments
I quit nebular, now i’m using another framework. Nebular is good but these kind of issues were very important to my project.
El dom., 6 de ene. de 2019 a la(s) 11:31, Ganapathy Mano ( notifications@github.com) escribió:
Same Issue. When I set my form fields and click for the calendar to open. I get the same error in the console and all the dates on the calendar are gone.