It doesn't seem like this forum is all that active lately, but it's worth a try anyway. Although actual documentation for all of the more advanced methods seems to be thin on the ground, I've managed to discover through a mixture of experimentation and forum searching most of what I want.
I've learnt that within the .format method, MMM can be specified for D, MMMM for Dec, MMMMM for December and so on (or something similar anyway). This has allowed me to get my airdate to display as (26 Dec 2003), which looks miles better than the default YYYY.MM.dd format and which I'm very happy with. However, what would make that airdate format absolutely perfect for me is the ability to specify the date in an "nth" format: 16th June 1995, 27th May 1997, 2nd December 2014, etc.
Does anyone know if this is already built into the program and I've just missed it? If not, is there any chance it could be implemented any time soon? It doesn't seem like it would take much work with similar functionality already built into the month, and I'd really appreciate it.
Thanks in advance!
"Nth" Date Format for Airdate
Re: "Nth" Date Format for Airdate
Adding 1st / 2nd / 3rd / 4th is possible but will require a bit of code. Not sure if there's a one-liner for that.
However, this date format might be close enough:
Here's the technical documentation for data patterns that can be used in Java / Groovy / FileBot:
https://docs.oracle.com/javase/8/docs/a ... l#patterns
If you really really want 1st / 2nd / 3rd / 4th then I can help you write code for that, but I don't currently have time, so you'd have to wait a week or so.
However, this date format might be close enough:
Code: Select all
16 June 1995
Code: Select all
dd MMMMM uuuu
https://docs.oracle.com/javase/8/docs/a ... l#patterns

Re: "Nth" Date Format for Airdate
As I mentioned in my post, that's the format that I'm currently using. But if it involves writing custom scripting just for my specific use case, then it's too small a difference to make it worth that, I just assumed that this would be simple enough to add into the proper functionality of the program.rednoah wrote: ↑14 Sep 2018, 05:40 Adding 1st / 2nd / 3rd / 4th is possible but will require a bit of code. Not sure if there's a one-liner for that.
However, this date format might be close enough:Code: Select all
16 June 1995
Here's the technical documentation for data patterns that can be used in Java / Groovy / FileBot:Code: Select all
dd MMMMM uuuu
https://docs.oracle.com/javase/8/docs/a ... l#patterns
If you really really want 1st / 2nd / 3rd / 4th then I can help you write code for that, but I don't currently have time, so you'd have to wait a week or so.
Re: "Nth" Date Format for Airdate
I made this for you... maybe you can use this ?
OR without ()
output e.g.
Code: Select all
{def day = airdate.day; def suffix = day == 31 ? 'st' : day == 22 ? 'nd' : day == 23 ? 'rd' : 'th'; '('+airdate.format("dd'${suffix} 'MMM yyyy")+')'}
Code: Select all
{def day = airdate.day; def suffix = day == 31 ? 'st' : day == 22 ? 'nd' : day == 23 ? 'rd' : 'th'; airdate.format("dd'${suffix} 'MMM yyyy")}
15th Jun 2018
Re: "Nth" Date Format for Airdate
version 2
I'm not sure what the correct way is but here you go:
I'm not sure what the correct way is but here you go:
Code: Select all
{def day = airdate.day; def suffix = (day == 31 || day == 21 || day == 1) ? 'st' : (day == 22 || day == 2) ? 'nd' : (day == 23 || day == 3) ? 'rd' : 'th'; airdate.format("dd'${suffix} 'MMM yyyy")}
Re: "Nth" Date Format for Airdate
It's a bit of a handful, but that's how it works. If there's demand for this particular feature, then I can add a built-in helper function.