Brian Dunning's FileMaker Custom Functions

month_AN_ML ( theMonthOrDate ; language ; abbrevOption ; monthNumOption ; style )

Get a month name or abbreviation in any language supported by the CF, and/or the month number, starting from a date or month number or starting from a month name or abbreviation provided in any supported language. Supported languages are: English, French, Spanish, Italian and Portuguese.

  Average rating: 4.0 (28 votes) Log in to vote

François Goulet   François Goulet
Lizzy Logik Inc.
Not applicable

Share on Facebook Share on Twitter

  Sample input:
month_AL_ML ( " septiembre " ; "" ; "" ; "" ; "" ) >
month_AL_ML ( " abr. " ; "" ; "" ; "2" ; "" ) >
month_AL_ML ( " 2014-12-25 " ; "En" ; "" ; "" ; "" ) >
month_AL_ML ( " 2014-08-25 " ; "Fr" ; "" ; "2" ; "" ) >
month_AL_ML ( " 2014-04-25 " ; "Pt" ; "" ; "1" ; "" ) >
month_AL_ML ( " 1 " ; "En" ; "" ; "" ; "" ) >
month_AL_ML ( " 01 " ; "Fr" ; 1 ; "" ; "" ) >
month_AL_ML ( " January " ; "Es" ; "" ; 1 ; "" ) >
month_AL_ML ( " January " ; "It" ; 1 ; 1 ; "" ) >
month_AL_ML ( " January " ; "Es" ; 1 ; 2 ; "" ) >
month_AL_ML ( " ene " ; "En" ; 1 ; 2 ; 1 ) >
month_AL_ML ( " 12. Dezembro " ; "It" ; "" ; " 2 " ; "1" ) >
month_AL_ML ( " 07. lug " ; "Fr" ; " 1 " ; 2 ; 2 ) >
  Sample output:
9
04
December
08. Août
4. abr
January
jan
1. enero
1. gen
01. ene
01. Jan
12. Dicembre
07. JUL

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

month_AN_ML ( theMonthOrDate ; language ; abbrevOption ; monthNumOption ; style ) v.2 - Modified the CF to enable it to return only the month number when the language field is left empty.
month_AN_ML ( theMonthOrDate ; language ; abbrevOption ; monthNumOption ; style ) v.1

Get a month name or abbreviation in any language supported by the CF, and/or the month number, starting from a date or month number or starting from a month name or abbreviation provided in any supported language. Supported languages are: English, French, Spanish, Italian and Portuguese.

OPTIONS:

1. theMonthOrDate: a date or a month name or month name abbreviation with or without a month number (1 or 01 for January ... 12 for December). Month names and abbreviations must strictly match names and abbreviations found in the LISTS OF MONTH NAMES or ABBREVIATIONS found in the CF. Please note however that abbreviations ending with a period will not compromise the CF's performance;

2. language: "EN" ; "FR" ; "ES" ; "IT" ; "PT" . Please note that leaving the language option empty will cause the CF to return only the month number;

3. abbrevOption: empty ("") to return the month name or "1" to return the month abbreviation;

4. monthNumOption: empty ("") to omit the month number prefix; "1" to return the month name prefixed by the month number - ex. 1. ; "2" to return the month number prefixed by a "0" for month numbers lower than 10 - ex. 01.

5. style: "" returns the result in lowercase in all languages except English which is always returned in titlecase; "1" for titlecase; "2" for uppercase

########################

EX:
month_AL_ML ( " septiembre " ; "" ; "" ; "" ; "" ) > 9
month_AL_ML ( " abr. " ; "" ; "" ; "2" ; "" ) > 04
month_AL_ML ( " 2014-12-25 " ; "En" ; "" ; "" ; "" ) > December
month_AL_ML ( " 2014-08-25 " ; "Fr" ; "" ; "2" ; "" ) > 08. Août
month_AL_ML ( " 2014-04-25 " ; "Pt" ; "" ; "1" ; "" ) > 4. abr
month_AL_ML ( " 1 " ; "En" ; "" ; "" ; "" ) > January
month_AL_ML ( " 01 " ; "Fr" ; 1 ; "" ; "" ) > jan
month_AL_ML ( " January " ; "Es" ; "" ; 1 ; "" ) > 1. enero
month_AL_ML ( " January " ; "It" ; 1 ; 1 ; "" ) > 1. gen
month_AL_ML ( " January " ; "Es" ; 1 ; 2 ; "" ) > 01. ene
month_AL_ML ( " ene. " ; "En" ; 1 ; 2 ; 1 ) > 01. Jan
month_AL_ML ( " 12. Dezembro " ; "It" ; "" ; " 2 " ; "1" ) > 12. Dicembre
month_AL_ML ( " 07. lug " ; "Fr" ; " 1 " ; 2 ; 2 ) > 07. JUL

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.