Adding th and rd to date

Does anybody know how to add th and rd to date?

How about this?

The sale will happen on the #DdL#th of #DMMMM#

This is how I did it on a text watch face you can also change the code to use numbers instead of full words.

CALENDAR NUMBERS USING WORDS: Using st, th, nd at end of words
$#DdL#==01?First:$$#DdL#==02?Second:$$#DdL#==03?Third:$$#DdL#==04?Fourth:$$#DdL#==05?Fifth:$$#DdL#==06?Sixth:$$#DdL#==07?Seventh:$$#DdL#==08?Eighth:$$#DdL#==09?Ninth:$$#DdL#==10?Tenth:$$#DdL#==11?Eleventh:$$#DdL#==12?Twelfth:$$#DdL#==13?Thirteenth:$$#DdL#==14?Fourteenth:$$#DdL#==15?Fifteenth:$$#DdL#==16?Sixteenth:$$#DdL#==17?Seventeenth:$$#DdL#==18?Eighteenth:$$#DdL#==19?Nineteenth:$$#DdL#==20?Twentieth:$$#DdL#==21?Twenty-first:$$#DdL#==22?Twenty-second:$$#DdL#==23?Twenty-third:$$#DdL#==24?Twenty-fourth:$$#DdL#==25?Twenty-fifth:$$#DdL#==26?Twenty-sixth:$$#DdL#==27?Twenty-seventh:$$#DdL#==28?Twenty-eighth:$$#DdL#==29?Twenty-ninth:$$#DdL#==30?Thirtieth:$$#DdL#==31?Thirty-first:$

It’s kind of long but it does work.

3 Likes

That worked a treat.

I don’t suppose you know how to get the AM/PM in lower case i.e. am/pm?

Kind regards,

Wayne

It’s not easy to do, depends on the condition how you want to apply it. In which case you need a lower case?

Hi Andrei,

I think i have managed to crak it…

This apears to do what I want.

#Dh#:#DmZ#$#Db#<=11? am:$$#Db#>=12? pm:$

The easiest way is to use #Da# and in the box that shows if the text will be right, left or center justified, you click either the AA or aa box to force Facer to make all the letters capitals or lower case.

In general, yes, the easiest solution is to just output your text.

Doh!

i hadn’t used that as yet bu will be doing from now on.

Cheers,

Wayne

1 Like

Or as the esteemed man @mrantisocialguy has written :slight_smile:

Many thanks for your help.

Here is my finished watch.

Any suggestions for refinement would be musch appreciated.

Kind regards,

Wayne

4 Likes

Wow, I love it, and number 01 means we met with an entomologist. It deserves a separate post. :+1:

1 Like

The only thing I would do would be to make the writing darker to be seen easier. Other than that I wouldn’t change anything.

1 Like

Did you see the wings flap on wake?

I see them open and close when the clock leaves DIM mode.

1 Like

Cheers, yes I was just checking.

Wayne

The most compact solution I have to date (due to the limitations of the conditional syntax) is below. It would be more compact if:

  • Conditionals had a “default” fall through: ie "None of the other conditions matched, so “th”

  • English wasn’t dumb (11th-13th)

  • I could have nested logic: ((A||B)&&C)?

However, it’s not too bad and works at least in Facer.io designer. Watch (Google Pixel) displays “3rd” (today) OK - so will have to wait and see if it remains correct.

In theory it should be a general solution (not just up to 31) - should work for all ordinals >0

#Dd#$#Dd#==1?st:$$#Dd#==2?nd:$$#Dd#==3?rd:$$#Dd#>3&&#Dd#<21?th:$$#Dd#>20&&#Dd#%10==0?th:$$#Dd#>20&&#Dd#%10==1?st:$$#Dd#>20&&#Dd#%10==2?nd:$$#Dd#>20&&#Dd#%10==3?rd:$$#Dd#>20&&#Dd#%10>3?th:$