Conditional AM/PM text?

Hi all. Is it possible to use something like this?
[IS_AFTNOON] <1? AM:PM
Unfortunately, it seems WFS doesn’t take those two texts as two separate results, it writes the whole “AM:PM” instead.
Thank you.

Yes it is.

([IS_24H]<1?[IS_AFTNOON]<1?"AM":"PM":" ")
2 Likes

Thank you so much! This is even more I expected! I maintained visibility using another condition in the text transparency. This is so much more elegant. :wink:

I don’t even use code anymore. WFS now has it built in using add component > digital clock which can be set for 12hour/24hour . once you have instances of 12 hour time, and 24 hour time, you use the add conditional line > 12/24H feature to set the 12 hour time layer to 12H, and the 24 hour time layer to 24H.

There’s even an option to break up the time HH:MM:SS into separate variables that I use with customized 12/24H bitmapped fonts.

3 Likes

If you wanted to display there anything else I would understand, but to display AM or PM you do not need any conditions. Simply add time component and enter only the [AMPM] tag and that’s all folks.

1 Like

This seems awesome! Thank you.

1 Like

To my understanding, this uses localized form. That means, I can get other expressions than AM/PM. Or…?

1 Like

Yes, and you can pick for which (if any) languages will be the localization active and rest will be replaced by default language.

2 Likes

Sorry for asking an obvious thing for some (I’m new to WFS), what if I want to display an object between a given am hour and a given pm hour ?

You can either use above mentioned conditional time line to set time
when it should be displayed,
image

or put in opacity field condition like
([HOUR_0_23]>=starting hour)*([HOUR_0_23]<ending hour)?100:0

(its reverse logic to what we discussed here: Using a logical operation)

2 Likes

Thanks a lot, this saved a lot of pulled hair ! ;.)

Thank you very much. I’ll look at it.

can i create digital and analog watchface in one watchface theme like…I’m customizing a watch face, and I want the analog hands to disappear when digital time is selected, and for the digital time text to disappear when analog hands are selected.

I think you can do that like in this guide:

2 Likes