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>
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Answered
Specification of the issue
- User: Pro
- Premium support: Yes
- Technology: MDB Angular
- MDB Version: 9.3.1
- Device: desktop
- Browser: Chrome
- OS: win
- Provided sample code: No
- Provided link: No
Tags
Related topics
Arkadiusz Idzikowski staff commented 5 years ago
What are the component options and what do you pass to the
locale
andngModel
inputs?architech pro premium priority commented 5 years 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 commented 5 years ago
locales
Arkadiusz Idzikowski staff commented 5 years ago
Thank you. Does
dateUntil
variable has any value on the component init?architech pro premium priority commented 5 years 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 5 years 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 commented 4 years ago
any updates on this issue ?
Arkadiusz Idzikowski staff commented 4 years ago
We are still working on the fix release.