Add short form month option

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
vertigo
Posts: 147
Joined: 28 Oct 2018 00:28

Add short form month option

Post by vertigo » 05 May 2020 04:58

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.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Add short form month option

Post by Desmanto » 05 May 2020 12:59

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
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

vertigo
Posts: 147
Joined: 28 Oct 2018 00:28

Re: Add short form month option

Post by vertigo » 05 May 2020 18:32

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."

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Add short form month option

Post by Desmanto » 05 May 2020 18:38

Yes, it seems the example is wrong, need to be fixed. I never spot that.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Add short form month option

Post by Martin » 07 May 2020 19:49

Thanks for reporting! I'll update the documentation and add another example.

Regards,
Martin

Locked