I have a calendar widget that is set up as a table and I have added a selected interaction style to each cell. I have named each cell with the date text that is in each cell. So each cell has a numeral for the name ie. “1” “2” etc.
Is there anyway I can set the selected state on a cell using the Now.getDate variable to choose which cell should be in the selected state?
I am trying to use a “now” button to set the selected cell to today’s date.
you could use condition text on(widget) equals [[Now.getDate()]] and then set the cell to selected. To fire this you need any event. Could be the onClick on button, show table or you could use the onload
I agree with the repeater approach. Using a repeater would let you use the one OnItemLoad action for your logic. You might even be able to change the days for each month with some work.
Repeater is definitely the way to go on this one. I did achieve this one myself. I’ve added the rp file as a starting point.
I say starting point as you will have to restructure the repeater data slightly to reflect this year. As I only included enough to cover 2014 when I built it. I think that once you update that, it should highlight again nicely Date_Picker.rp (132 KB)
Had a play this morning and what you need to do is look at the filters on the month selection dynamic panel. Update those to be correct and the whole thing will fall into place.
My memory of this code is pretty hazy. That said, I updated this so it's (relatively) easier to change the date format. That said, you will need to familiarize yourself with the date functions, which you'll find listed in the Insert Variable or Function link in the fx box.
The second line of code in the OnClick handler of the calendarDay rectangle is where you want to do the formatting . It's currently set to this:
set text on clickedDay equal to [[date.getDayOfWeek()]] [[date.getMonthName()]] [[date.getDate()]], [[date.getFullYear()]]
"date" above is a local variable pointing at the selected date in MM/DD/YYYY format. The above uses various date functions to extract values for: first the name of the weekday, then the name of the month, then the current date in the month, and then the year.
Hi Joseph, (I hope I got the name right)
Many thanks, I got it
sorry for another question: is there a way to save the date “result” as a parameter and use it on another page/state?