B4A Library [B4X] [XUI] AS Scheduler ? - MonthView, DayView (Week), AgendaView and CalendarView [Payware]

sdleidel

Active Member
Licensed User
Longtime User
B4J with Windows 11 have a Problem. (Weekview)
The window is maximized, click one "Week later" then this is the result:

 

roddy

Member
Licensed User
Longtime User
Why is the appointment circle not displayed at the beginning, and the appointment circle will be displayed only after pressing the first month and then the previous month ?

like this video http:\\kaduo.xyz:2480\ASScheduler_CalendarViewMonth.mp4

What step am I missing ?


Here is the code::
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("frm_main")

    B4XPages.SetTitle(Me,"CalendarView Example")

    ASScheduler_CalendarViewMonth1.API.ClearAppointments
    ASScheduler_CalendarViewMonth1.API.ClearBlackouts
    ASScheduler_CalendarViewMonth1.API.ClearSpecialDays
    
    Dim StartDate As Long = DateUtils.SetDate(2023,8,15)
    
    ASScheduler_CalendarViewMonth1.StartDate = StartDate
    ASScheduler_CalendarViewMonth1.WeekNameShort = ASSchedulerUtils.CreateASScheduler_WeekNameShort("星期一","星期二","星期三","星期四","星期五","星期六","星期日")
    ASScheduler_CalendarViewMonth1.MonthNameShort = ASSchedulerUtils.CreateASScheduler_MonthNameShort("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月")
    ASScheduler_CalendarViewMonth1.RefreshScheduler()

    ASScheduler_CalendarViewMonth1.API.CreateAppointment(ASSchedulerUtils.CreateASScheduler_Appointment(0,"Test Appointment 1","Description",xui.Color_ARGB(255,73, 98, 164),False,StartDate,StartDate + DateTime.TicksPerHour*1))
    ASScheduler_CalendarViewMonth1.API.CreateAppointment(ASSchedulerUtils.CreateASScheduler_Appointment(0,"Test Appointment 3","Description",xui.Color_ARGB(255,45, 136, 121),False,StartDate,StartDate + DateTime.TicksPerHour*1))
    ASScheduler_CalendarViewMonth1.API.CreateAppointment(ASSchedulerUtils.CreateASScheduler_Appointment(0,"Test Appointment 4","Description",xui.Color_ARGB(255,140, 198, 101),False,StartDate + DateTime.TicksPerDay*2,StartDate + DateTime.TicksPerDay*2 + DateTime.TicksPerHour*1))
    
    ASScheduler_CalendarViewMonth1.RefreshScheduler()
        
End Sub
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.05
    • CalendarView
      • BugFixes
What step am I missing ?
Nothing, but maybe this updates helps. If not, then try it with a Sleep(0) between the last CreateAppointment and RefreshScheduler

ASScheduler_CalendarViewMonth1.RefreshScheduler()
and you call 2 times RefreshScheduler, this is pointless and only consumes resources unnecessarily.
 

roddy

Member
Licensed User
Longtime User

Updated to 3.05
it's worked. thank you.
 

roddy

Member
Licensed User
Longtime User
Can I change TextColor of ASScheduler_CalendarViewMonth ?
 
Last edited:

roddy

Member
Licensed User
Longtime User
I have encountered a strange situation
When entering the APP for the first time, the WeekName is displayed overlapping "一" and "Mon".



It's normal to change the month and then come back.

how do i fix it ?

Here is the code::
Sub ShowCalendar()
    ASScheduler_CalendarViewMonth1.API.ClearAppointments
    ASScheduler_CalendarViewMonth1.API.ClearBlackouts
    ASScheduler_CalendarViewMonth1.API.ClearSpecialDays
    
    Dim StartDate As Long = DateTime.Now
    
    ASScheduler_CalendarViewMonth1.StartDate = StartDate
    ASScheduler_CalendarViewMonth1.WeekNameShort = ASSchedulerUtils.CreateASScheduler_WeekNameShort("一","二","三","四","五","六","日")
    ASScheduler_CalendarViewMonth1.MonthNameShort = ASSchedulerUtils.CreateASScheduler_MonthNameShort("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月")
    
    ASScheduler_CalendarViewMonth1.BodyProperties.TextColor = xui.Color_black
    
    
    For i=0 To ApoinList.Size-1
        ASScheduler_CalendarViewMonth1.API.CreateAppointment(ASSchedulerUtils.CreateASScheduler_Appointment(i,"name","test",xui.Color_ARGB(255,255, 165, 0),False,StartDate ,StartDate + DateTime.TicksPerHour*1))
    Next
    
    ASScheduler_CalendarViewMonth1.RefreshScheduler()
End Sub
 

roddy

Member
Licensed User
Longtime User
Hello, i can't reproduce it with the given informations. Please provide an example project what shows the problem. Thanks.
I found the reason.

If the attribute Left & Right Edge Distance is set to 0, it will be normal. If it is set greater than 0, it will be shifted.

This problem only occurs on B4i, B4A is no problem.

Can this problem be fixed?


 

roddy

Member
Licensed User
Longtime User
ASScheduler_CalendarViewMonth has another problem in B4i.

This line of command has no effect.
Here is the code::
ASScheduler_CalendarViewMonth1.MonthNameShort = ASSchedulerUtils.CreateASScheduler_MonthNameShort("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月")

September should be changed to "九月", like the photo has not changed.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Can this problem be fixed?
This is not a bug of the AS_Scheduler library. It's a bug of the AS_ViewPager, because this view is not made not to go across the entire width. I'll see what I can do.
This line of command has no effect.
This is not the function that is responsible for the text in the header.
The text for the header comes from the DateUtils:
B4X:
DateUtils.GetMonthName(m_StartDate) & " " & DateTime.GetYear(m_StartDate)
Set your device language to your local language, then it will have the right text.
 

Alexander Stolte

Expert
Licensed User
Longtime User
If the attribute Left & Right Edge Distance is set to 0, it will be normal. If it is set greater than 0, it will be shifted.
Sorry, I still can't recreate it. When I set Left and Right to 10dip, everything still works as it should.
 

roddy

Member
Licensed User
Longtime User
My Device language is right.


when i change month, it's show right.


but, it's not chang in canlendar view


This problem only occurs on B4i, B4A is no problem.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.07
    • CalendarView
      • Add Event CustomHeaderText
CustomHeaderText
B4X:
Private Sub ASScheduler_CalendarViewMonth1_CustomHeaderText(Date As Long, xlbl_HeaderText As B4XView)
    If ASScheduler_CalendarViewMonth1.CurrentView = ASScheduler_CalendarViewMonth1.CurrentView_MonthView Then       
        xlbl_HeaderText.Text = "Test " &  DateUtils.GetMonthName(Date) & " " & DateTime.GetYear(Date)       
    End If
End Sub
but, it's not chang in canlendar view
Use the new CustomHeaderText Event.
 

roddy

Member
Licensed User
Longtime User
The new CustomHeaderText event solved my problem, thank you very much.
 

DBernaert

Member
Licensed User
Hi,

is there a possibility to set colors on the Agendaview?
SetTheme does not seem to be available for this view.

Thx,
Dominique
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…