Private Sub cmdHRSDatePicker_Click
Private now As Long = DateTime.now
pnlHours.loadlayout("DP")
cmdHRSDatePicker.Enabled = False
Private today As Int = DateTime.GetDayOfMonth(now)
Private YYYY As String = DateTime.GetYear(now)
Private MDs As List = Array As Label(d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18, d19, d20, d21, d22, d23, d24, d25, d26, d27, d28, d29, d30, d31, d31, d32, d33, d34, d35, d36, d37, d38, d39, d40, d41, d42)
Dim saveformat As String = DateTime.DateFormat
DateTime.dateformat = "F"
'activemonth is the current month
If activeMonth.Length = 1 Then activeMonth = $"0${activeMonth}"$
Private TT As String = ($"${activeMonth}/01/${YYYY}"$)
Private firstday As Int = (DateTime.GetDayOfWeek(DateTime.Dateparse(TT))) 'dateparse("04/19/2025")
Log(firstday) 'DateTime.GetDayOfWeek(firstday))
'set the text of MDs(firstday) to 1
spnYears.Addall(Array(activeYear - 1, activeYear))
spnMonths.Addall(Array("Jan", "Feb", "Mar", "Apr", "May","Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"))
spnMonths.SelectedIndex = activeMonth - 1
spnYears.SelectedIndex = spnYears.indexof(activeYear)
DateTime.DateFormat = saveformat