Android Question AS DatePicker Month selector Min/Max

fbritop

Well-Known Member
Licensed User
Longtime User
Hi
For the lib:
https://www.b4x.com/android/forum/t...h-year-decade-century-rangedatepicker.139957/

In the example, using month selector (in designer), I change some code to:


B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("frm_main")   
    B4XPages.SetTitle(Me,"AS DatePicker Example")   
    
    AS_DatePicker1.MinDate=DateTime.DateParse("01/01/2023")
    AS_DatePicker1.MaxDate=DateTime.DateParse("09/01/2025")
    AS_DatePicker1.SelectedDateColor=Colors.Blue
    AS_DatePicker1.CurrentDateColor=Colors.blue
    AS_DatePicker1.Rebuild
    Sleep(0)
    AS_DatePicker1.Scroll2Date(DateTime.DateParse("01/01/2025"))
    AS_DatePicker1.SelectedDate=DateTime.DateParse("08/01/2025")
    AS_DatePicker1.Refresh
    AS_DatePicker1.RefreshSelectedDate
End Sub


I dont know why I need to call Scroll2Date in order to set the minDate, if not it still shows the months of Oct,Nov & Dec 2025

Also, maxDate is set to Sep/2025, it hides OK the rest of the months, but if you swipe to the right, you can go to year 2026 with all 12 months. Same think for minDate, you are able to navigate backwards

SelectedDate does not highlights the selected month in blue

No sure about the order of properties is a reason for some properties not to be engaged.

Thanks
 

fbritop

Well-Known Member
Licensed User
Longtime User
Not yet,
I have attached a small proyecto with your library as a module instead of lib, in order to debug, but could not find the bug,
 

Attachments

  • ASDatePicker.zip
    22.7 KB · Views: 13
Upvote 0
Top