Problem with recognizing specific days

I don't know why but suddenly my snippet doesn't recognize the correct days, instead of saying Wednesday today it says Monday

{if: {time: d} == 1 and {time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11} Monday{elseif: {time: d} == 2 and {time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11} Tuesday{elseif: {time: d} == 3 and {time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11} Wednesday{elseif: {time: d} == 4 and {time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11} Thursday{elseif: {time: d} == 5 and {time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11} Friday{elseif: {time: d} == 6 and {time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11} Saturday{endif}

Hi @guillaume.bottacci Welcome to the forum! :slight_smile:

How about using this simplified snippet:

{today_day={time: dddd}; trim=yes}

Today is {=today_day}

{if: today_day = "Monday"}Today is Monday
{else}Today is not Monday{endif}

Does it work for you?

Thanks @Gaurang_Tandon, it should also take into account the months for different texts related to certain months

In that case, to update your snippet, I think you need the parentheses on the month condition:

{if: {time: d} == 1 and ({time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11)} Monday{elseif: {time: d} == 2 and ({time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11)} Tuesday{elseif: {time: d} == 3 and ({time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11)} Wednesday{elseif: {time: d} == 4 and ({time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11)} Thursday{elseif: {time: d} == 5 and ({time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11)} Friday{elseif: {time: d} == 6 and ({time: MM} == 09 or {time: MM} == 10 or {time: MM} == 11)} Saturday{endif}

Let me know if it works for you.

All right, thank you very much. It works perfect now. :slightly_smiling_face: