Sunrise 12/24 hr match user selection for time

Hi Facers, is it possible to modify the sunrise/sunset tags so they match users #DB# selection 12/24: This face Lazarus Design - TIMESHIFT - watch face for Apple Watch, Samsung Gear S3, Huawei Watch, and more - Facer, allows users to select 12/24 hr but unfortunately if 24hr is selected the sunrise sunset doesn’t look right. Here’s a user review:

I suppose you could show or hide the 12 and 24 hour sunrise/sunset text using the tag:

#DTIMEFORMAT# User’s preferred time format (12/24)

as in, for sunrise hour text, in 12hr format:
Text: #WRh#
Opacity: $#DTIMEFORMAT#==12?100:0$

and for sunrise hour text, in 24hr format:
Text: #WRH#
Opacity: $#DTIMEFORMAT#==12?0:100$

I hope that helps.

Hi Mike, thanks for your quick response can I just check, should the 24hr part read (24?) your reply they both have 12?:
#DTIMEFORMAT# User’s preferred time format (12/24)

and for sunrise hour text, in 24hr format:
Text: #WRH#
Opacity: $#DTIMEFORMAT#==24?0:100$

1 Like

I just swapped the results of the conditional statement but kept the test the same. That is, in the first case, if the user has selected 12 then set opacity to 100. In the second, if they have not then set it to 100. As there are only two possibilities this covers both of the 12/24hr choices.

So, the statements

$#DTIMEFORMAT#==12?0:100$

and

$#DTIMEFORMAT#==24?100:0$

are effectively equivalent - they both will set opacity to 100 when the user has selected 24hrs.

So that begs the question why not just change the test, as in the second statement?

There should only be two cases, it is either 12 or it is 24. But, maybe there are more that I don’t know about - so by keeping the test the same but changing the result I can be sure that all cases are covered. That is, it is either 12 ( then show the 12hr text ) or it is not 12 ( then show the 24hr text ).

But as I said, either should work.

:slight_smile:

Thanks Mike, much appreciated :slight_smile:

1 Like

Hi Mike, I’m being a bit thick but I can’t get this to work, here’s a link to the face in question, Lazarus Design - TIMESHIFT - watch face for Apple Watch, Samsung Gear S3, Huawei Watch, and more - Facer

2 Likes

Hi Mike, my bad, just tried again with your original expression and I think it’s working - please excuse my ignorance and thanks again for all your help much appreciated

1 Like

Happy Facer, it worked cheers Mike :+1::muscle:

1 Like

You are most welcome, I’m glad it worked.

:slight_smile: