First, create the variable in the Settings menu, Variable Overview. You can crete them as well in the script using LET or SET (the first evaluates the right part of the "=" then stores, the latter only stores as a literal what comes to the right of the "=").
Check this application that uses variables and sliders/calendar objects with a calendar table.
Hope that helps.
1. create variable as go to document properties -> variables -> click on new button -> name the variable. your variable gets created.
2. right click on sheet -> new sheet object -> select slider/calender object -> on general tab -> click checkbox variables -> select the variable you have created -> on general tab provide min and max value which is the minimum and maximum date which you want to take in calender. Either you can hard code the date or provide any expression.
3. your calender object gets created. select any date from the calender.
4. to see the date take text object and provide expression:
your date gets displayed.