B4J Question [ABMaterial] ABMDateTimeScroller Isn't working

jinyistudio

Well-Known Member
Licensed User
Longtime User
Why i just can change hour, cann't change minitue ?

B4X:
Dim NewDate As Long = DateTime.Now
    Dim mydate1 As ABMDateTimeScroller   
    mydate1.Initialize(page, "mytime1", ABM.DATETIMESCROLLER_TYPE_TIME,ABM.DATETIMESCROLLER_MODE_SCROLLER,NewDate, "Pick a time", "")
    mydate1.TitleTimeFormat = "HH:mm"        
    mydate1.ReturnTimeFormat = "HH:mm"
    mydate1.TimeShowAMPM = False
    mydate1.CancelText = "Close"
    mydate1.PickText = "OK"
    extraSideBar.Content.Cell(2,1).AddComponent(mydate1)
    '
    Dim mydate2 As ABMDateTimeScroller
    mydate2.Initialize(page, "mytime2", ABM.DATETIMESCROLLER_TYPE_TIME,ABM.DATETIMESCROLLER_MODE_SCROLLER,NewDate, "Pick a time", "")
    mydate2.TitleTimeFormat = "HH:mm"
    mydate2.ReturnTimeFormat = "HH:mm"
    mydate2.TimeShowAMPM = False
    mydate2.CancelText = "Close"
    mydate2.PickText = "OK"
    extraSideBar.Content.Cell(3,1).AddComponent(mydate2)

379c76d65cb0ca110b26002d7cbdbe99.png
 

alwaysbusy

Expert
Licensed User
Longtime User
I think your format is wrong, it should be HH:ii instead of HH:mm. I know this does not seem logic, however this was how the original developer of this control made it. See in the demo the params:

B4X:
'    DateFormat:
'    -----------   
'  m - month of year (no leading zero)
'  mm - month of year (two digit)
'  M - month Name short
'  MM - month Name long
'  d - day of month (no leading zero)
'  dd - day of month (two digit)
'  D - day of week (short)
'  DD - day of week (long)
'  y - year (two digit)
'  yy - year (four digit)
'  '...' - literal text
'  '' - single quote
'  anything Else - literal text

'    TimeFormat:
'    -----------   
'  h - 12 hour format (no leading zero)
'  hh - 12 hour format (leading zero)
'  H - 24 hour format (no leading zero)
'  HH - 24 hour format (leading zero)
'  i - minutes (no leading zero)
'  ii - minutes (leading zero)
'  s - seconds (no leading zero)
'  ss - seconds (leading zero)
'  a - lowercase am/pm
'  A - uppercase AM/PM
'  '...' - literal text
'  '' - single quote
'  anything Else - literal text
 
Upvote 0
Top