Picker is it possible to change values and display values dynamically?

I want to make a date and time picker using Picker.
I want that when there months contain 29 days, the days options will be reduced to 29, and when there months selected with 30 or 31, it will be adjusted respectively as well.

I only found a way to set a “maximum” value - so if user set 31 and then changes to a month with 29, it will set the value to 29 and by the time he will try to set it to 30 or 31 it will auto get changed to 29 - but this is not a good behaviour - it should delete the 30 and 31 and show only 29 otherwise he will think that there is a bug in the app or something.

That’s the method I am using right now (followed by the official f7 docs):

      const daysInMonth = DateParser.GetDaysInMonth(month, year).length // 29 or 30 or 31

      if (typeof picker.cols[6] !== "undefined" && day > daysInMonth) {
        picker.cols[6].setValue(daysInMonth) // maximum set instead of change values

I have tried this:

picker.cols[6].values = daysInMonth

But it doesn’t reflect the change so old values remain.


In Kitchen Sink, check “Dependent values” and “Inline Picker / Date-time” picker examples