# Can't have something disappear at two times of the day

Hi, I want a png’s transparency to go to 100 at two times of the day, and stay at 0 the rest of the time, but i can only get it to do it at one time on the day,
for example,

this works:
\$#Db#==12&&#Dm#==0?100:0\$

and all of those don’t:
\$#Db#==12&&#Dm#==0||#Db#==3&&#Dm#==30?100:0\$
\$(#Db#==12&&#Dm#==0)||(#Db#==3&&#Dm#==30)?100:0\$
\$#Db#==12&&#Dm#==0 || #Db#==3&&#Dm#==30?100:0\$

Am I doing something wrong?

P.S. I know this is gonna activate at both PM and AM, I’m gonna add #Da# when i get it to work

I’m not sure how to go about doing that with one string of code but one possible way to accomplish it would be to have two of the same layers. Then have a window of time where each is visible. For example this string below is visible between 6am to 6pm. Just change the times to whatever time you want yours to be visible. Then do the same with your second layer.

\$#Dk#>=6&&#Dk#<=18?100:0\$

Does that make sense?

yes, but I need to give that string to many objects, so i would end up having almost double the objects i have right now

I see, I was under the impression that it was only one object. Unfortunately I’m fairly new at the coding so I’m not sure how to solve this problem otherwise, sorry. Someone better than I will find it before to long and help you though.

Check out the documentation on boolean logic: Boolean Logic | Facer Documentation

It looks like the limit on conditional operators in a single formula is 3, which would explain why “\$#Db#==12&&#Dm#==0?100:0\$” works but not the others. It might be better to clone the objects and change the clones to become visible at your 2nd chosen time of day.

There might be another method using expressions though. Check the documentation and see what you can find.

This formula works:

`\$((#DH#*100)+(#Dm#))==1200||((#DH#*100)+(#Dm#))==1530?100:0\$`

It makes an element visible at 12:00 PM (or 1200 hours) and 3:30 PM (or 1530 hours).

1 Like

Thank you so much! that’s a brilliant solution!

1 Like