Update Popup Calendar every day

Hi, I have a problem updating a popup calendar every day. I have two popup calendar, one for the start of the shift and other for the end of the shift. The problem is I set a date like “2015/09/29 08:00:00 AM” it doesn’t change until I set another date.

I tried this:

dateFormat(now(0), "yyyy-M-dd 08:00:00")

With this code the date update every day, but only when I open the window. What can I do if the windows is always open? the station is always ON, then never is going to update again.

What can I do in this case?

You could change the poll rate of the run expression function. The poll rate is in milliseconds.

For example if you changed the poll rate to once an hour then the day will automatically change when the day changes.

To check for an update once an hour you could do this:

dateFormat(now(3600000), "yyyy-M-dd 08:00:00")

Notice that no actual change occurs until the day changes.

You can test that this method works by testing it on a smaller scale.
Use the following expression and notice that the minute only changes when the current minute changes.
The polling rate is set to 1 second.

dateFormat(now(1000), "yyyy-M-dd 08:mm:00")

Best,

Is there a way to just update the date? not the time, so the operator can set a start or end of the shift and not change back to 08:00:00 ? because if I set the pool rate to once a hour, every hour will be set back to 08:00:00. maybe I must change the pool rate to 8 hours o more depending the shift, but it’s not going to change exactly when the day changes.

by the way, I’m trying to activate a Expression tag when now() is between a start time and an end time, I don’t need the date.

dateExtract(now(), "hour") >= {[~]start hour} && dateExtract(now(), "hour") <= {[~]end hour}

With this code I write to the tags with a numeric text field and it works but if I need to include minutes, I can’t figure it out how to do it.

I solved it, I used a label with this expression:

dateFormat(now(), "yyyy-M-dd "+{Root Container.hour.intValue}+":"+{Root Container.minute.intValue}+":"+{Root Container.seconds.intValue})

the “now()” just update the date, and the hour, minute and seconds are inserted to a tag or component by the operator.

Then in my expression tag I used this:

now()>=todate({[~]startDate}) && now()<= todate({[~]endDate})