Bug? [ABMaterial] ABMCalendar -DayClicked

MichalK73

Well-Known Member
Licensed User
Longtime User
Hello.
I noticed an error during the DayClicked method in ABMCalendar.
Namely, the procedure gets a date e.g. 2020-10-07. There is a monthly view. I make a jump to the day view for this day but it always pops up the day before that is on 2020-10-06.

B4X:
    Sub calendar_DayClicked(date As String)
        Dim calendar As ABMCalendar = page.Component("calendar")
        calendar.ChangeView(ABM.CALENDAR_DEFAULTVIEW_DAY)
        calendar.GotoDate(date)
    End Sub

To properly jump to the date I have to do something like this.

B4X:
    Sub calendar_DayClicked(date As String)
        Dim calendar As ABMCalendar = page.Component("calendar")
        calendar.ChangeView(ABM.CALENDAR_DEFAULTVIEW_DAY)
        Dim p As Period
        p.Initialize
        p.Days = 1
        date = DateTime.Date(DateUtils.AddPeriod(DateTime.DateParse(date), p))
        calendar.GotoDate(date)
    End Sub
 
Last edited:
Top