I’m trying to set a couple of calendars in order to use them as “From - Until” selector for a report. I made them work with the report but I have a problem with the Date property. I want to automatically set the Date from the calendars to now and to 1 day before now but also I need to let the users change that range if they want and there is where I have the problem.
I tried to bind calendar’s property Date(immediate and latched) to now() but that doesn’t allow me to change the selected day, when I try to change the calendar’s time it returns automatically to now() in this case.
Can you give a hint here? I thing that I might set the date using scripting doing something like event.source.date = now() but I’m not sure how to do it or how to call the date object in jython.
What I do is create date SQL tags for start date and end date so to solve your problem I would set the end date to now and the start date to 1 day before now using date arithmetic function. Then bind these tags to the date immediate on your two calender components. Your calender will always open with the SQL tag values and also allow changing them to whatever the user wants. Make sure to keep bidirectional unchecked when binding to calender component or it will update with SQL values