Topic: datepicker value undefined when shown
Expected behavior Datepicker component in in hidden div. When div is shown datepicker components displays correct placeholder text.
Actual behavior When showing hidden div, datepicker component displays value "00 undefined 0"
Resources (screenshots, code snippets etc.)
<button type="button" mdbBtn outline="true" rounded="true" size="sm" (click)="formVisible = !formVisible"
class="px-2 text-darkgray" mdbWavesEffect>
<mdb-icon fas icon="search" class="mt-0"></mdb-icon>
</button>
<ng-container *ngIf="formVisible">
<div class="col-md-5 md-form">
<mdb-date-picker [(ngModel)]="dateUntil" [options]="datePickerOptions" name="dateUntil" [inline]="true"
[locale]="'cardscore.locale'" [placeholder]="'cardscore.CardRequestsOverview.filter_dateTo' | translate">
</mdb-date-picker>
</div>
</ng-container>
Answered
- User: Pro
- Premium support: Yes
- Technology: Angular
- MDB Version: 9.3.1
- Device: desktop
- Browser: Chrome
- OS: win
- Provided sample code: No
- Provided link: No
Arkadiusz Idzikowski staff commented 9 months ago
What are the component options and what do you pass to the
localeandngModelinputs?architech pro premium priority vip early access commented 9 months ago
for datepicker I have only one option - date format
datePickerOptions: IMyOptions = { dateFormat: 'dd-mm-yyyy' };
locales are paset below because here I couldn't format it well
architech pro premium priority vip early access commented 9 months ago
locales
Arkadiusz Idzikowski staff commented 9 months ago
Thank you. Does
dateUntilvariable has any value on the component init?architech pro premium priority vip early access commented 9 months ago
no it doesn't - it's a component scoped variable. aslo ... if I use datepicker options: export const datePickerOptions: IMyOptions = { // Year limits minYear: 1999, maxYear: 2021,
// Show Today button showTodayBtn: true, dateFormat: 'dd-mm-yyyy', // Show Clear date button showClearDateBtn: true,
};
then it takes 13 seconds for datepicker to show popup. When in the popup I click "clear" then datepicker component shows placeholder text - which should be initial state of the datepicker.
Arkadiusz Idzikowski staff commented 9 months ago
Thank you for the additional information. We will take a closer look at those problems and let you know what we found.
architech pro premium priority vip early access commented 8 months ago
any updates on this issue ?
Arkadiusz Idzikowski staff commented 8 months ago
We are still working on the fix release.