Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

Problem setting min and max for the new datetime comp

$
0
0

Hello,

i’m trying to dynamically set the min and max values for the v6 datetime component.

If i use viewchild

<ion-datetime #datePicker size="cover" presentation="time" hourCycle="h23" [(ngModel)]="time"></ion-datetime>

 @ViewChild('datePicker') datePicker: IonDatetime;

this.datePicker.min='2021-12-20T11:00';

I get TypeError: Cannot set properties of undefined (setting ‘min’)

And if i use

  <ion-datetime size="cover" presentation="time" hourCycle="h23" [(ngModel)]="time" min="min" max="max"></ion-datetime>

  min: string = "2021-12-20T13:00";
  max: string = "2021-12-20T23:59";

I get Cannot destructure property ‘month’ of ‘parseDate(…)’ as it is undefined.

I there a way to set these properties ? It was working with the prev datetime comp

Thank you

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>