Topic: Display error on date picker
ufasoli pro answered 7 years ago
<div class="jumbotron flex-fill"> <form #searchForm="ngForm" (ngSubmit)="doSearch()"> <div class="row m-2 form-group"> <div class="col-sm-6 " *ngIf="depots"> <mdb-select [(ngModel)]="search.fromDepot" id="fromDepot" name="fromDepot" [options]="depots" title="Dépôt de début" > </mdb-select> <label class="mr-sm-2" for="fromDepot">Dépôt début:</label> </div> <div class="col-sm-6" *ngIf="depots"> <mdb-select [(ngModel)]="search.toDepot" id="destinationDepot" [options]="depots" name="destinationDepot" title="Dépôt de fin" > </mdb-select> <label class="mr-sm-2" for="destinationDepot">Dépôt fin:</label> </div> </div> <div class="row m-2 align-items-center"> <div class="col-md-3 "> <mdb-date-picker [options]="dateOptions" name="startTimeStart" [placeholder]="' '" [label]="'Date début de'" [(ngModel)]="search.startTimeStart" mdbWavesEffect></mdb-date-picker> </div> <div class="col-md-3 mt-2"> <mdb-time-picker [buttonLabel]="'OK'" [twelvehour]="false" [darktheme]="false" [label]="'à'" [(ngModel)]="search.startTimeStartT" name="startTimeStartT" mdbWavesEffect></mdb-time-picker> </div> <div class="col-md-3 align-items-center"> <mdb-date-picker [options]="dateOptions" name="startTimeEnd" [placeholder]="' '" [label]="'Date début à'" [(ngModel)]="search.startTimeEnd" mdbWavesEffect></mdb-date-picker> </div> <div class="col-md-3 align-items-center mt-2"> <mdb-time-picker [buttonLabel]="'OK'" [twelvehour]="false" [darktheme]="false" [label]="'Heure fin'" [(ngModel)]="search.startTimeEndT" name="startTimeEndT" mdbWavesEffect></mdb-time-picker> </div> </div> <div class="row m-2 align-items-center"> <div class="col-md-3 "> <mdb-date-picker [options]="dateOptions" name="endTimeStart" [placeholder]="' '" [label]="'Date fin de'" [(ngModel)]="search.endTimeStart" mdbWavesEffect></mdb-date-picker> </div> <div class="col-md-3 mt-2"> <mdb-time-picker [buttonLabel]="'OK'" [twelvehour]="false" [darktheme]="false" [label]="'à'" [(ngModel)]="search.endTimeStartT" name="endTimeStartT" mdbWavesEffect></mdb-time-picker> </div> <div class="col-md-3 align-items-center"> <mdb-date-picker [options]="dateOptions" name="endTimeEnd" [placeholder]="' '" [label]="'Date fin à'" [(ngModel)]="search.endTimeEnd" mdbWavesEffect></mdb-date-picker> </div> <div class="col-md-3 align-items-center mt-2"> <mdb-time-picker [buttonLabel]="'OK'" [twelvehour]="false" [darktheme]="false" [label]="'à'" [(ngModel)]="search.endTimeEndT" name="endTimeEndT" mdbWavesEffect></mdb-time-picker> </div> </div> <div class="m-2 d-flex flex-row-reverse"> <button type="submit" class="btn btn-primary waves-light" mdbWavesEffect>Rechercher <i class="fa fa-search"></i> </button> <button type="button" class="btn btn-blue-grey waves-light" (click)="resetSearch()" mdbWavesEffect>Reinitialiser <i class="fa fa-eraser"></i></button> </div> </form> </div>
Damian Gemza staff commented 7 years ago
Dear ufasoli, Unfortunately, I'm unable to reproduce your second case. Could you please send me your project at d.gemza@mdbootstrap.com? I would like to check your code. Best Regards, DamianDamian Gemza staff commented 7 years ago
Dear ufasoli, About 1st question: instead of using label element, please use [label]=" 'your-label' " on datepicker element, and pass there mdbInputDirective, and you're label will be lifted up.FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: Yes
Damian Gemza staff commented 7 years ago
Dear ufasoli, About the first problem - I'm noticing this, and we'll try to fix this ASAP. For now, please use [placeholder]=" ' Some placeholder ' " instead of label. About the second problem - Could you please provide me reproduction code which shows your case? Best Regards, Damian