how do you set the .MinYear using PreferencesDialog with "type": "Date"
Year cannot be before jan 1, 2019how do you set the .MinYear using PreferencesDialog with "type": "Date"
Private minyear As String = "2019"
'Date cannot be before jan 1, 2019
Sub Pref_IsValid (TempData As Map) As Boolean
Dim x As Long =DateTime.dateparse("1/1/" & minyear)
Dim d As Long = TempData.GetDefault("Date", DateTime.Now)
If d < x Then
prefdialog.ScrollToItemWithError("Date")
Return False
End If
Return True
End Sub
The B4XPreferenceDialog date is based on the B4XDateTemplate class located in the XUI Views library. It defaults to a minum year of 1970, but you can change it in your code by adding this linebut I have to manage smaller dates than 1960
Private minyear As String
prefdialog.DateTemplate.MinYear =1950 'add this line so you can navigate beyond 1970
minyear ="1960"
Did it work for you or not. That is what counts. You need to let us know, either by responding or putting a 'like' if it helpedThanks for your reply