This is a simple DatePicker, with which you can quickly reach your target date. With a click on the header the view changes.
I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee.
Make sure you are using ASViewPager V1.31+
ASDatePicker
Author: Alexander Stolte
Version: 1.00

I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee.
- In the month view, you can select a date
- In the year view, you select a month
- In the decade you see a range of 10 years
- In century you can see 100 years
Make sure you are using ASViewPager V1.31+
ASDatePicker
Author: Alexander Stolte
Version: 1.00
- ASDatePicker_HeaderProperties
- Fields:
- Height As Float
- IsInitialized As Boolean
Tests whether the object has been initialized.
- Functions:
- Initialize
Initializes the fields to their default value.
- Initialize
- Fields:
- ASDatePicker_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.
- Initialize
- Fields:
- ASDatePicker_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.
- Initialize
- Fields:
- AS_DatePicker
- Events:
- SelectedDateChanged (Date As Long)
- Fields:
- mBase As B4XView
- Tag As Object
- Functions:
- ChangeView (NewView As String)
- Class_Globals As String
- CreateASDatePicker_HeaderProperties (Height As Float) As ASDatePicker_HeaderProperties
- CreateASDatePicker_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 ASDatePicker_MonthNameShort
- CreateASDatePicker_WeekNameShort (Monday As String, Tuesday As String, Wednesday As String, Thursday As String, Friday As String, Saturday As String, Sunday As String) As ASDatePicker_WeekNameShort
- DesignerCreateView (Base As Object, Lbl As Label, Props As Map) As String
Base type must be Object - getBodyColor As Int
- getCurrentDateColor As Int
- getCurrentView_CenturyView As String
- getCurrentView_DecadeView As String
- getCurrentView_MonthView As String
- getCurrentView_YearView As String
- GetFirstDayOfWeek2 (Ticks As Long, FirstDayOfWeek As Int) As Long
FirstDayOfWeek:
Friday = 1
Thursday = 2
Wednesday = 3
Tuesday = 4
Monday = 5
Sunday = 6
Saturday = 7 - getHeaderColor As Int
- getHeaderPanel As B4XView
You can customize the appereance of the header
With the following code you can customize the control elements that are visible in the header:
<code>
'Middle Text Label
Dim xlbl_Header As B4XView = AS_DatePicker1.HeaderPanel.GetView(0)
'Left Arrow Label
Dim xlbl_ArrowLeft As B4XView = AS_DatePicker1.HeaderPanel.GetView(1)
'Right Arrow Label
Dim xlbl_ArrowRight As B4XView = AS_DatePicker1.HeaderPanel.GetView(2)
</code> - getSelectedDateColor As Int
- GetWeekNameByIndex (Index As Int) As String
1 = Sunday - Initialize (Callback As Object, EventName As String) As String
- IsInitialized As Boolean
Tests whether the object has been initialized. - setBodyColor (Color As Int) As String
- setCurrentDateColor (Color As Int) As String
- setFirstDayOfWeek (number As Int) As String
1-7
Friday = 1
Thursday = 2
Wednesday = 3
Tuesday = 4
Monday = 5
Sunday = 6
Saturday = 7 - setHeaderColor (Color As Int) As String
- setSelectedDateColor (Color As Int) As String
- Properties:
- BodyColor As Int
- CurrentDateColor As Int
- CurrentView_CenturyView As String [read only]
- CurrentView_DecadeView As String [read only]
- CurrentView_MonthView As String [read only]
- CurrentView_YearView As String [read only]
- FirstDayOfWeek
1-7
Friday = 1
Thursday = 2
Wednesday = 3
Tuesday = 4
Monday = 5
Sunday = 6
Saturday = 7 - HeaderColor As Int
- HeaderPanel As B4XView [read only]
You can customize the appereance of the header
With the following code you can customize the control elements that are visible in the header:
<code>
'Middle Text Label
Dim xlbl_Header As B4XView = AS_DatePicker1.HeaderPanel.GetView(0)
'Left Arrow Label
Dim xlbl_ArrowLeft As B4XView = AS_DatePicker1.HeaderPanel.GetView(1)
'Right Arrow Label
Dim xlbl_ArrowRight As B4XView = AS_DatePicker1.HeaderPanel.GetView(2)
</code> - SelectedDateColor As Int
- Events:
- 1.00
- Release
- 1.01
- Add Scroll2Date - Scrolls to the date
- B4J Resize BugFixes
- 1.02
- BugFixes
- Add designer property InactiveDaysVisible - Displays the days that are not in the current month
- Default: False
- Add Type ASDatePicker_BodyProperties
- Font of the Text
- TextColor of the Text
- The month view now has 6 lines instead of 5
- It may be that if InactiveDaysVisible = False that an empty line is seen
- 1.03
- B4J Only - Add Designer Property MouseHoverFeedback
- Default: True
- B4J Only - Add Designer Property MouseHoverFeedback
- 1.04
- Add Refresh
Attachments
Last edited: