Force colour change?

I have a global that changes colour on day change.. at least it should but it won’t actually change colour until I open the widget config briefly.

I’m certainly no coder but I kind of understand why this happens but is there a way to force the change automatically?

My formula looks something like this:

$if(df(EEE)=mon,#111111*,*
df(EEE)=tue,#222222)$**

Grateful for any suggestions!

Hi @Williams ,

Try the following tips:

Weekday to Color

The formula used to change the color, based on the weekday short name:

$gv(tc(low,df(EEE)))$

I hope this would help.

:smiling_face::+1:

Did you set the KWGT app battery to “Unrestricted” in your phone settings?

Using df(EEE) = mon will break the widget if the system language changes. Use day numbers instead—df(e) outputs 1 for Monday, 2 for Tuesday, etc. It works globally on any language.

Your corrected formula should look like this:$if(df(e)=1, #FF111111, df(e)=2, #FF222222, #FF333333)$

@Baju_Santiko thank you I will try this! :folded_hands:t2:

@MaxP I have unrestricted setting on and everything else works and changes as it should (I have other stuff changing with days too). Thanks I hadn’t realised about the English day names! :man_facepalming:t2:

Ok, another problem I think I’m about to have :joy: that’s somewhat related to this..

I have created a font with “images” containing current weekday and if I use EEE to point to a specific image (letter) it won’t work unless english but if I use day number (e) there’s a problem when week is set to start on Sunday vs Monday right? I hope you understand how i mean..

0=Sat 1=Sun 2=Mon? This is driving me crazy the numbers corresponding to correct weekdays make no sense to me.

EDIT. I’m not sure but I think I got it now.. :man_shrugging:t2:

Here’s the setup I’m working on and you can see where I use weekdays to change color and “image”.

Hi @Williams ,

You can set your preferred First day of the week in the app settings.

I hope this would help.

:smiling_face::+1:

Thanks for the fast reply! :folded_hands:t2:

You can use $df(f) — ISO day of week (number, 1 = Monday).

@MaxP awesome thank you!