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

Alexander Stolte

Expert
Licensed User
Longtime User
Today is the year two anniversary of the AS_Scheduler, I would like to thank the people who supported the project and sent me bugs and new feature requests. This way I could already release 43 updates 62 updates that made the product better. It was not an easy task to develop everything stable for all 3 platforms.

Last year i released 16 updates for the AS_Scheduler.
Performance has been drastically improved. But my goal for this year is to improve the performance even more.

A sneak preview of upcoming updates:
  • Performance improvents if you use e.g. DayView, MonthView and AgendaView at the same time at the same page
  • Notifications - A notification system with local notifications for appointments
  • Appointment resize - Lengthen or shorten an appointment with the mouse or finger
 

asales

Expert
Licensed User
Longtime User
I want to make a backup of the data and restore in another device.
I tried to copy the scheduler.db to share but I get this error when I use this code:
B4X:
Code:
File.Copy(xui.DefaultFolder,"scheduler.db", Provider.SharedFolder, FileName)

Error:
java.io.FileNotFoundException: scheduler.db: open failed: EROFS (Read-only file system)
There is a easy way to make a backup/restore or share the data?

Thanks in advance.
 

Alexander Stolte

Expert
Licensed User
Longtime User
I tried to copy the scheduler.db to share but I get this error when I use this code:
Works here, try it with another folder, you probably don't have write access to your target.
B4X:
File.Copy(xui.DefaultFolder,"scheduler.db",File.DirInternal,"test.db")

And please always specify the platform on which the error occurred. Even if it is B4X, I use platform-specific code, so errors can only occur on one platform, so it helps me enormously to know where to look.
 
Last edited:

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.17
    • API
      • Add BackupDatabase
      • Add RestoreDatabase
Can be tested with the following example code:
B4X:
#If B4J
    xui.SetDataFolder("scheduler")
#End If

    Sleep(4000)
    Log("Backup")
    ASSchedulerUtils.API.BackupDatabase(xui.DefaultFolder,"test.db")
    
    ASScheduler_MonthView1.API.ClearAppointments
    ASScheduler_MonthView1.API.ClearBlackouts
    ASScheduler_MonthView1.RefreshScheduler
    
    Sleep(4000)
    Log("Restore")
    ASSchedulerUtils.API.RestoreDatabase(xui.DefaultFolder,"test.db")
    
    ASScheduler_MonthView1.RefreshScheduler
 

asales

Expert
Licensed User
Longtime User
Worked fine. Thank you very much!
I made a backup with FileProvider and a restore with ContentChooser.

Just one question: Why the "Sleep(4000)"?
 

Alexander Stolte

Expert
Licensed User
Longtime User
Just one question: Why the "Sleep(4000)"?
The debug mode is slow and so that everyone has enough time to load, I pause for 4 seconds. This way I can also recognize the changes and know that the backup and restore are working.

Worked fine
My favorite thing to read
 

asales

Expert
Licensed User
Longtime User
Just a curious (not a requested feature):
can I change the background to use an image instead a solid color?
 

asales

Expert
Licensed User
Longtime User
Unless you mean the background of Appointments, or the background of other things that have a CustomDrawEvent.
Thanks for the information.
I could understand better and make other tests.

I managed to change the background of the AgendaView by setting the image and change the body color property to transparent.
 

asales

Expert
Licensed User
Longtime User
In the CalendarViewWeek I can change the numbers of the days with this line:
B4X:
ASScheduler_CalendarViewWeek1.BodyProperties.TextColor = xui.Color_Black
but I don't found how to change the text color of the names of the days and the month/year.

 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.18
    • CalendarView
      • Add WeekNameProperties
      • Add Event CustomDrawHeader
WeekNameProperties
B4X:
    ASScheduler_CalendarViewMonth1.WeekNameProperties.TextColor = xui.Color_Red
    ASScheduler_CalendarViewMonth1.RefreshScheduler


    ASScheduler_CalendarViewWeek1.WeekNameProperties.TextColor = xui.Color_Red
    ASScheduler_CalendarViewWeek1.RefreshScheduler
CustomDrawHeader
B4X:
Private Sub ASScheduler_CalendarViewMonth1_CustomDrawHeader(Date As Long,Views As ASScheduler_CalendarView_CustomDrawHeader)
  
    Views.xlbl_ArrowLeft.TextColor = xui.Color_Red
    Views.xlbl_ArrowRight.TextColor = xui.Color_Red
    Views.xlbl_Text.TextColor = xui.Color_Red
  
End Sub

Private Sub ASScheduler_CalendarViewWeek1_CustomDrawHeader(Date As Long,Views As ASScheduler_CalendarView_CustomDrawHeader)
  
    Views.xlbl_ArrowLeft.TextColor = xui.Color_Red
    Views.xlbl_ArrowRight.TextColor = xui.Color_Red
    Views.xlbl_Text.TextColor = xui.Color_Red
  
End Sub

how to change the text color of the names of the days and the month/year.
B4X:
    ASScheduler_CalendarViewWeek1.HeaderProperties.TextColor = xui.Color_Red
    ASScheduler_CalendarViewWeek1.WeekNameProperties.TextColor = xui.Color_Red
    ASScheduler_CalendarViewWeek1.RefreshScheduler
B4X:
Private Sub ASScheduler_CalendarViewWeek1_CustomDrawHeader(Date As Long,Views As ASScheduler_CalendarView_CustomDrawHeader)
  
    Views.xlbl_ArrowLeft.TextColor = xui.Color_Red
    Views.xlbl_ArrowRight.TextColor = xui.Color_Red
    Views.xlbl_Text.TextColor = xui.Color_Red
  
End Sub
 

Alexander Stolte

Expert
Licensed User
Longtime User
Update
  • 3.19
    • DayView
      • Add Designer Property MultiDayAppointmentShowMode
        • Default: OnTop
      • Appointments that last longer than 1 day are now always displayed at the top.
        • Previously, you had to scroll to the top of the list to make them visible
        • This has caused confusion
      • BugFixes and Performance Improvements
    • API
      • BugFix on GetAppointmentCountInRange
MultiDayAppointmentShowMode
  • OnTop
    • Appointments that last longer than 1 day are displayed at the top
  • Normal
    • Appointments that last longer than 1 day are displayed as normal together with the other appointments
 
Last edited:

asales

Expert
Licensed User
Longtime User
In the AS CalendarExpandable and AS CalendarAdvanced we have the minDate, maxDate and SetLimitRange functions.

Can I set a range in the components of this lib to limit the calendars to the current month or 1 month back and 1 month forward, for example?

Thanks in advance for your support.
 

Alexander Stolte

Expert
Licensed User
Longtime User
Can I set a range in the components of this lib to limit the calendars to the current month or 1 month back and 1 month forward, for example?
This is not yet possible, I will implement it in the next few days.
 

DavidMeees

Member
Licensed User
Could someone help with ASScheduler update appointment my example code does not show an error but does not work

ASScheduler_DayView1.API.UpdateAppointment(ASSchedulerUtils.CreateASScheduler_Appointment(0,TextName.text & " " & TextPostcode.Text,TextJobNum.Text,xui.Color_aRGB(argb(0),argb(1),argb(2),argb(3)),False,MyTime,MyTime + DateTime.TicksPerHour*1.5))


B4XPages.MainPage.ASScheduler_DayView1.RefreshScheduler
' B4XPages.MainPage.ASScheduler_DayView1.RefreshComplete
 

Alexander Stolte

Expert
Licensed User
Longtime User
API.UpdateAppointment(ASSchedulerUtils.CreateASScheduler_Appointment(0
To update an appointment, you must also specify the appointment id, otherwise the API will not know which data record you are referring to. I would have seen this immediately if the code you provided were in code tags.

And next time please make a new thread so that other users who have the same problem can also find it in the forum search, thank you.
 

ykucuk

Well-Known Member
Licensed User
Longtime User
Hello,

I am adding appointments to a calendar using the code below. There are more than 50 appointments, and often many of them are not added to the calendar. I believe the next process is being started before the previous one is completed, causing the add operation to fail. Is there a way to implement a "wait for" structure for CreateAppointment? Or how can I resolve this issue?


B4X:
Dim d As Long = DateTime.DateTimeParse(colrows.Get("startDate"),colrows.Get("startTime"))
Dim e As Long = DateTime.DateTimeParse(colrows.Get("endDate"),colrows.Get("endTime"))

ASScheduler_MonthView1.API.CreateAppointment(ASSchedulerUtils.CreateASScheduler_Appointment(colrows.Get("id"),colrows.Get("title"),colrows.Get("id"),GetEventColor (colrows.Get("category")),False,d,e))

Sleep(10)
 

Alexander Stolte

Expert
Licensed User
Longtime User
Hello, unfortunately you are not giving me enough information to be able to help you at all. You only show me how to add an appointment to the api, but not how to call the refresh function of the respective view afterwards. In general, you don't even say with which view the problem occurs, the AS_Scheduler has many views. Please create a new thread about your problem, with more information and preferably an example project where I can understand what you are doing and in the best case see the error myself. Thank you very much, have a nice day

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