B4A Library [B4X] AS WheelDateTimePicker - based on ASWheelPicker

This is a date and time picker in IOS picker design.

This library is based on the ASWheelPicker, without it the library will not work.

EQ5gfV8j4u2d3PaEtXi6p57dQCY9h7883CRjIizpVHqLx7YXhY.jpeg

Use:
B4X:
AS_WheelDateTimePicker1.Create

ASWheelDateTimePicker
Author: Alexander Stolte
Version: 1.00

  • ASWheelDateTimePicker_MonthName
    • Fields:
      • April As String
      • August As String
      • December As String
      • February As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • January As String
      • July As String
      • June As String
      • March As String
      • May As String
      • November As String
      • October As String
      • September As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASWheelDateTimePicker_MonthNameShort
    • Fields:
      • April As String
      • August As String
      • December As String
      • February As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • January As String
      • July As String
      • June As String
      • March As String
      • May As String
      • November As String
      • October As String
      • September As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • ASWheelDateTimePicker_WeekNameShort
    • Fields:
      • Friday As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
      • Monday As String
      • Saturday As String
      • Sunday As String
      • Thursday As String
      • Tuesday As String
      • Wednesday As String
    • Functions:
      • Initialize
        Initializes the fields to their default value.
  • AS_WheelDateTimePicker
    • Events:
      • SelectedDateChanged (Date As Long)
      • SelectedTimeChanged (Hour As Int, Minute As Int)
    • Fields:
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • Class_Globals As String
      • CreateASWheelDateTimePicker_MonthName (January As String, February As String, March As String, April As String, May As String, June As String, July As String, August As String, September As String, October As String, November As String, December As String) As ASWheelDateTimePicker_MonthName
      • CreateASWheelDateTimePicker_MonthNameShort (January As String, February As String, March As String, April As String, May As String, June As String, July As String, August As String, September As String, October As String, November As String, December As String) As ASWheelDateTimePicker_MonthNameShort
      • CreateASWheelDateTimePicker_WeekNameShort (Monday As String, Tuesday As String, Wednesday As String, Thursday As String, Friday As String, Saturday As String, Sunday As String) As ASWheelDateTimePicker_WeekNameShort
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
        Base type must be Object
      • getHour As Int
      • getMinute As Int
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Tests whether the object has been initialized.
    • Properties:
      • Hour As Int [read only]
      • Minute As Int [read only]
Changelog
  • 1.00
    • Release
  • 1.01
    • BugFixes
  • 1.02
    • Add set Hour
    • Add set Minute
    • Add set Date
  • 1.03
    • Add Refresh
  • 1.04
    • BugFixes
    • PickerType = DatePicker - The days in the month now adjust automatically
    • Add Designer Property TextColor
    • Add Designer Property FadeColor
    • Add Designer Property HapticFeedback
  • 1.05
    • Add Designer Property TodayText
      • Default: Today
    • Add get and set TodayText - Call Refresh if you change something
  • 1.06
    • BugFixes
  • 1.07
    • BugFixes - AM and PM mode works now as expected
    • BugFixes - setDate Number of days is now adjusted
  • 1.08
    • Add get and set FadeColor
    • Add get and set TextColor
    • Add get and set SelectorColor
    • Add get and set BackgroundColor
    • MonthName now comes from the DateUtils
  • 1.09
    • BugFixes
  • 1.10
    • BugFixes
  • 1.11
    • Add Designer Property MinuteSteps - 1-5-10-15 Block Interval
      • Default: False
  • 1.12
    • BugFixes
  • 1.13
    • Add get WheelPicker - gets the wheelpicker to modify font etc.
  • 1.14 (read more)
    • You need AS_WheelPicker V3.15+ for this update
    • If a month has 30 or 28 days, then these are now no longer removed from the list, but the new EnabledRow is used and the affected items are deactivated.
      • This prevents the list from behaving in an unusual way.
    • Add MinDate and MaxDate - You can specify a DateRange what may be selected
  • 1.15
    • You need AS_WheelPicker V3.20+
    • Breaking Change: You need to call Create
      • The view will not be built without it
      • Now you can make changes to the proepties without calling refresh at the beginning
      • Faster loading time
      • No crashes
    • Add SetDateTextOrder - You can change the text order of the date text
    • BugFixes
    • Add Event CustomDrawItemChange
Have Fun :)
 

Attachments

  • AS WheelDateTimePicker Example.zip
    176.3 KB · Views: 89
  • AS_WheelDateTimePicker.b4xlib
    6.7 KB · Views: 94
Last edited:

Unobtainius

Active Member
Licensed User
Longtime User
😍
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.03
    • Add Refresh
Hi, can you clear me a doubt, how do I leave the months in ASWheelDateTimePicker in Portuguese?
yes you can:
B4X:
AS_WheelDateTimePicker2.MonthNameShort = AS_WheelDateTimePicker2.CreateASWheelDateTimePicker_MonthNameShort("J.","F.","M.","A.","M.","J.","J.","A.","S.","O.","N.","D.")
AS_WheelDateTimePicker2.Refresh
 
wich invalid date error?
when selecting the date February 29, it gives an invalid date error.

what about that one?
1661175740548.png

the Background color property does not work, the component is always in black
only if it's possible and it's not too much trouble
 

Unobtainius

Active Member
Licensed User
Longtime User
wich invalid date error?
when selecting the date February 29, it gives an invalid date error.

what about that one?
View attachment 132812
the Background color property does not work, the component is always in black
only if it's possible and it's not too much trouble
For what year?
Youre not forgetting leap years are you?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 1.04
    • BugFixes
    • PickerType = DatePicker - The days in the month now adjust automatically
    • Add Designer Property TextColor
    • Add Designer Property FadeColor
    • Add Designer Property HapticFeedback
Needs AS WheelPicker V3.03+

The February 29, 2022 is now no longer be selectable
 

MarcoRome

Expert
Licensed User
Longtime User
it is possible to set it with the current date and time.
I tried with
B4X:
AS_WheelDateTimePicker1.Date = DateTime.Now
but without success
 
Top