Current behavior:
I am using a NbDatePicker and @nebular/date-fns with format "dd/MM/yyyy" and I have already set the proper LOCALE_ID in the app.module.ts. When I select a date from the date picker the date is properly set according to the format in the input text box. But when I load the page providing a initial value in the format dd/MM/yyyy and then I click on the textbox to show the calendar, the calendar is taking the date with day and month inverted, so if the day is more than 12 I saw NaN in the month field, otherwise I saw the day and month inverted.
So if I pass "04/07/2024" as initial text string to the input text the calendar view is set on 7th April 2024 instead of 4th July 2024.
In case of NaN (so day > 12) I saw this in the console:
core.mjs:9171 ERROR TypeError: Cannot read properties of undefined (reading 'length')
at NbCalendarMonthModelService.isShouldAddPrevBoundingMonth (nebular-theme.mjs:4957:25)
at NbCalendarMonthModelService.withBoundingMonths (nebular-theme.mjs:4916:18)
at NbCalendarMonthModelService.createDaysGrid (nebular-theme.mjs:4907:21)
at NbCalendarDayPickerComponent.ngOnChanges (nebular-theme.mjs:5128:42)
at NbCalendarDayPickerComponent.rememberChangeHistoryAndInvokeOnChangesHook (core.mjs:1526:14)
at callHook (core.mjs:2508:18)
at callHooks (core.mjs:2467:17)
at executeCheckHooks (core.mjs:2399:5)
at refreshView (core.mjs:12020:21)
at refreshEmbeddedViews (core.mjs:13039:17)
Expected behavior:
So if I pass "07/04/2024" as initial text string to the input text the calendar view should be set on 7th April 2024.
Issue type
**I'm submitting a
Issue description
Current behavior: I am using a NbDatePicker and @nebular/date-fns with format "dd/MM/yyyy" and I have already set the proper LOCALE_ID in the app.module.ts. When I select a date from the date picker the date is properly set according to the format in the input text box. But when I load the page providing a initial value in the format dd/MM/yyyy and then I click on the textbox to show the calendar, the calendar is taking the date with day and month inverted, so if the day is more than 12 I saw NaN in the month field, otherwise I saw the day and month inverted. So if I pass "04/07/2024" as initial text string to the input text the calendar view is set on 7th April 2024 instead of 4th July 2024.
In case of NaN (so day > 12) I saw this in the console:
Expected behavior: So if I pass "07/04/2024" as initial text string to the input text the calendar view should be set on 7th April 2024.
Steps to reproduce:
Related code:
This is the code in app.module.ts
And I added the following imports in the @NgModule
This is the html piece for the calendar (ruleDateStart is the string of initial date in the format dd/MM/yyyy):
Other information:
npm, node, OS, Browser
Angular, Nebular