Hi,
I'm having a similar problem.
I ahve a montlhy calendar where I want to display the schedules.
I have created a script function that is called inside in the dataEvent with the use of the expression function runScript().
This is the script that retrieves the next schedules
def getCalendar():
#I create an empty dataset
header = ["startDate","endDate","displayColor","display"]
calendar = system.dataset.toDataSet(header,[])
turni=["Turno 1","Turno 2","Turno 3","Turno 4"]
displayColors=["blue","orange", "green","red"]
i=0
for turno in turni:
#custom functions that get the next start date of the schedule and the next end date
startDateTurno=getNextTurnStart(turno)
endDateTurno=getNextTurnEnd(turno)
displayColor=displayColors[i]
users=getScheduleUsers(turno)
display=turno + ": "
for user in users:
display=display + user + " "
#Popolo le righe del ddataset con le date di inizio e fine dei 4 turni
newRow = [startDateTurno,endDateTurno,displayColor,display]
calendar = system.dataset.addRow(calendar,newRow)
i=i+1
return calendar
When the page is opened the script runs and a dataset with the data is created but the start and end dates are in the String type and so no event are displayed.
When I retrieve the two dates inside the function they are in the date format but the datsaet column are in the String type.
To prove that I used the system.date.now() for all the dates and the dataset in the calendar but still the data format is String