Page 1 of 1

Add short form month option

Posted: 05 May 2020 04:58
by vertigo
The dateformat only has MM or MMM options to format the month part of the date as either the number (e.g. 01) or the long name (e.g. January). It needs an option to format as the short name (Jan). It could either be done as MM/MMM/MMM or MM/mm/MMM for 01/Jan/January.

Re: Add short form month option

Posted: 05 May 2020 12:59
by Desmanto
I got short name when using MMM. Try this script and check it in debug dialog

Code: Select all

a = getDate(2020, 1, 1);
MM = "{a,dateformat,MM}"; //01
MMM = "{a,dateformat,MMM}"; //Jan
MMMM = "{a,dateformat,MMMM}"; //January
all = "{a,dateformat,MM/MMM/MMMM}"; //01/Jan/January

Re: Add short form month option

Posted: 05 May 2020 18:32
by vertigo
Ok, so turns out I was wrong. I just so happened to try and use this in the one month that's the same in both short- and long-format (May) which is why I didn't notice. I was just basing my assumption that there was only MMM=long-format on the examples given in AutoMagic on the dateformat patter characters help screen. It only shows examples with MM that result in the month as a number and with MMM that result in a long-format month. So it seems the real issue is that that example needs to be changed from "September" to "Sep" and another example needs to be added that uses MMMM and "September."

Re: Add short form month option

Posted: 05 May 2020 18:38
by Desmanto
Yes, it seems the example is wrong, need to be fixed. I never spot that.

Re: Add short form month option

Posted: 07 May 2020 19:49
by Martin
Thanks for reporting! I'll update the documentation and add another example.

Regards,
Martin