FACER Community

Change the colour of #DE# depending on what day it is?

I use this string to present day and date: #DE# #Dd# #DMMM#

Is it possible to change the colour of #DE# depending on what day in the week it is?

I would like it to be blue om Saturdays and red on Sundays on my Gear 3 with Tizen.

1 Like

you will need to duplicate your date element two times and use conditions in opacity field to turn on and off on correct days. I will help if needed

3 Likes

Hi jlcash61,
Please help out. Any colour on Monday to Friday, and blue on Saturdays and red on Sundays.
Regards
Thomas

3 Likes

A working formula / pictures would be nice.

2 Likes

Take a look at this and see if it does what you want. Let me know how else I can help. Please share here with inspection open so way can take a look inside and help better.:sunglasses:

3 Likes

Nice Little Tutorial coming along . The conditional you have Give here is the Fundamental of Many Formulas that make a Smart Watch Smart . Good Job I say .

4 Likes

Yes, trying to show right way instead of my way lol🤣

3 Likes

I was trying to check the example, but for some reason it seems not to be inspectable too.

1 Like

odd, When I saw you post I went over to it and rocket opened up🤔 should i open oringinal file in editor and save and update?

1 Like

Hello, if you would like only the #DE# part of the string to change color, you would have to split to separate layer. Anyway you would have to make 3 copies of your string - one for each color.
Then control their visibility for example with formula in opacity like
for sunday: $#DOW#==0?100:0$
for saturday: $#DOW#==6?100:0$
for the rest: $(#DOW#+5)%6<5?100:0$

1 Like

I was able to Inspect your test above . Good working Example .

Check the way you share the link. It should let you mark it as inspectable by clicking the slider before copying the link:

1 Like

:+1: Yes inpection is on, dont know why you cant see.

1 Like

Now it works and I see, I did not need to post, its all in there :slight_smile:

2 Likes

i likely would have ((#DOW#==0)*100) ie if I was doing and have grown very fond of the modu(%) function but was afraid i would confuse them

1 Like

I just checked on an alternative way to hide the week days when showing Saturday and Sunday.
$#DOW#=0||#DOW#=6?0:100$

2 Likes

Difficult crossing Zero . That is by far and away the best and most descriptive way of doing it . Nice Little Tutorial Developing . If && ( AND ) don’t work try || ( OR ) .

2 Likes

Thanks all. I’ll try it out during the weekend :slight_smile:

1 Like

petruuccios, this worked perfect. I’m happy :slight_smile: