Page 1 of 1

Full Form Dates

Posted: 17 Dec 2020 21:59
by ChrisRead
Hi,

I like to use full form dates in titles for sources e.g. 1st March 1927 or 23rd May 1834 etc. and it would be nice to be able to do this easily as part of the options for configuring the Title Templates.

There isn't a {DAY} sub tag for this format, so I have attempted to cook one up using =IF, =EQUALS and =OR functions. but it's not working correctly as yet. I think it is all correctly nested but I always get the default 'th' regardless rather than a 'st' or 'nd'. I'm not sure if I am miss-using the functions or have misinterpreted the correct use.

Here is what I have tried so, far.
{DATE.DAY}=IF[=OR[=EQUALS[DATE.DAY%1]%=OR[=EQUALS[DATE.DAY%21]%=EQUALS[DATE.DAY%31]]]%st%=IF[=OR[=EQUALS[DATE.DAY%2]%=EQUALS[DATE.DAY%22]]%nd%=IF[=OR[=EQUALS[DATE.DAY%3]%=EQUALS[DATE.DAY%23]]%rd%th]]] {DATE.MONTH.FULL} {YEAR}

Essentially trying to output st when the day is 1, 21 or 31, nd when it is 2 or 22 and rd for 3 or 23.

I'm currently trying simple single functions to see if they work as I have interpreted.

Re: Full Form Dates

Posted: 17 Dec 2020 22:04
by ChrisRead
Well, I figured out one problem, I was not putting {} around the keys. Doh. :cry:

So, the final solution is
{DAY.DAY}=IF[=OR[=EQUALS[{DATE.DAY}%1]%=OR[=EQUALS[{DATE.DAY}%21]%=EQUALS[{DATE.DAY}%31]]]%st%=IF[=OR[=EQUALS[{DATE.DAY}%2]%=EQUALS[{DATE.DAY}%22]]%nd%=IF[=OR[=EQUALS[{DATE.DAY}%3]%=EQUALS[{DATE.DAY}%23]]%rd%th]]] {DATE.MONTH,FULL} {YEAR}

So 2/4/1937 displays as 2nd April 1937 etc.

Re: Full Form Dates

Posted: 18 Dec 2020 20:55
by ChrisRead
The conclusion of my posts is that it would be nice to have a {DATE.DAYORDINAL} or {DATE.DAYORD} sub tag to make it a lot easier and clearer to use than my dirty great expression.

Probably back of the queue of ideas I expect, given I have a solution for now, unless someone comes up with a better one.

Cheers for all your work,

Chris

Re: Full Form Dates

Posted: 27 Jan 2021 13:20
by ChrisRead
Hi,

Just spotted the release of 7.1 on another thread, and see that you have added the {DATE.DAY.ORD}, many thanks for that.

I am about to download it and try it out. It will definitely shorten my title templates a lot. :D

Re: Full Form Dates

Posted: 27 Jan 2021 13:51
by NickWalker
Yes I didn't have time last night to advertise it properly and am working currently so will publicise it when I get the chance.