Datepicker eror: date.getMonth is not a function
See original GitHub issueIssue type
I’m submitting a … (check one with “x”)
- bug report
- feature request
Issue description
Current behavior:
I am using the DatePicker component and it returns:
NbCalendarViewModeComponent.html:2 ERROR TypeError: date.getMonth is not a function
at NbNativeDateService.getMonthName (index.js?b4ac:5532)
at NbCalendarViewModeComponent.getText (index.js?b4ac:4972)
at Object.eval [as updateRenderer] (NbCalendarViewModeComponent.html:2)
at Object.debugUpdateRenderer [as updateRenderer] (core.js?f18e:46485)
at checkAndUpdateView (core.js?f18e:45467)
at callViewAction (core.js?f18e:45827)
at execComponentViewsAction (core.js?f18e:45755)
at checkAndUpdateView (core.js?f18e:45468)
at callViewAction (core.js?f18e:45827)
at execEmbeddedViewsAction (core.js?f18e:45784)
I think it is the same error that the calendar component has #2250
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:8 (4 by maintainers)
Top Results From Across the Web
getmonth() is not a function error parsing date - Stack Overflow
getmonth() is not a function error parsing date · 3. It means that d.production_date isn't a date object. · 2. var dt =...
Read more >Date.getMonth is not a function - Haxe Community
In Haxe 4.0. 0-rc. 3, it appears in JavaScript generated code the date string function is retrieving parts of a date to generate...
Read more >[Solved] TypeError: date.getDate is not a function - ItsJavaScript
getDate is not a function occurs if we call a getDate() method on the object that is not of type Date object. We...
Read more >Uncaught TypeError: date.getMonth is not a function - Reddit
getMonth is not a function " error which is causing hell with the execution of the datepicker. The calendar gets wiped clear when...
Read more >Stuck with an error getMonth() - Google Groups
I would recommend verifying that the cell value is indeed in the format you expect (using a regex) before passing it to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hi @yggg
you were right, now it works therefore I close this ticket.
I was quite sure to pass a Date and not a string 😦
Not sure if it’s fixed by #2330 as in the original issue posting the error appears in the
NbCalendarViewModeComponent
and #2330 fixes errors coming from theNbCalendarDayCellComponent
. If someone still facing the issue fromNbCalendarViewModeComponent
, please check the value of thedate
property onNbCalendarViewModeComponent
. To do this:Elements
tab in the dev tools find thenb-calendar-view-mode
element and click on it, so it becomes selectedConsole
tab and typeng.getComponent($0).date
date
property from the console here.