Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

dateLiteralEnFr ( theDate ; language ; dayOption ; yearOption )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.4  (31 votes)
  Discuss this Custom Function

François Goulet, Lizzy Logik Inc.
Not applicable

Given a date and and a language -

Sample Input:
dateLiteralEnFr( "2014-07-25"; "EN" ; 2 ; "") >
dateLiteralEnFr( "2014-07-25"; "FR" ; 2 ; "") >
Sample Output:
FRIDAY, July 25 2014
VENDREDI, 25 juillet 2014


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Click here to copy To Clip Manager if you have myFMbutler's Clip Manager installed

Description:

DateLiteralEnFr(language; dateField; dayOption; yearOption) v.1
DateLiteralEnFr(language; dateField; dayOption; yearOption) v.2 (Changes made to: 1 argument name and order + examples; variables presentation) - Thank you Teg!

Given a date and a language ("EN" for English" or "FR" for French), the CF returns the literal date in the chosen language.

- Options for "dayOption" are: ""; "1"; "2"; "3"; "4"
- Options for "yearOption" are: ""; "1"

EX:

DateLiteralEnFr( "2014-07-25" ; "EN"; ""; "") > July 25 2014
DateLiteralEnFr( "2014-07-25" ; "FR"; ""; "") > 26 juillet 2014

DateLiteralEnFr( "2014-07-25" ; "EN"; 1; "") > Friday, July 25 2014
DateLiteralEnFr( "2014-07-25" ; "FR"; 1; "") > Vendredi, 25 juillet 2014

DateLiteralEnFr( "2014-07-25" ; "EN"; 2; "") > FRIDAY, July 25 2014
DateLiteralEnFr( "2014-07-25" ; "FR"; 2; "") > VENDREDI, 25 juillet 2014

DateLiteralEnFr( "2014-07-25" ; "EN"; 3; "") > Friday (BOLD), July 25 2014
DateLiteralEnFr( "2014-07-25" ; "FR"; 3; "") > Vendredi (BOLD), 25 juillet 2014

DateLiteralEnFr( "2014-07-25" ; "EN"; 4; "") > FRIDAY (BOLD), July 25 2014
DateLiteralEnFr( "2014-07-25" ; "FR"; 4; "") > VENDREDI (BOLD), 25 juillet 2014

DateLiteralEnFr( "2014-07-25" ; "EN"; ""; "1") > July 25
DateLiteralEnFr( "2014-07-25" ; "FR"; ""; "1") > 25 juillet

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

This is my Custom Function and I want to edit it

Discuss:

Nice idea, but can be executed less convoluted; also, the argument order in your example is incorrect …

Try

/* LiteralDate_EN_FR ( theDate ; language ; dayOption ; yearOption ) */

Let ( [
dt = theDate ;
y = Year ( dt ) ;
m = Month ( dt );
d = Day ( dt ) ;
dow = DayOfWeek ( dt ) ;

mn = Case ( language = "EN" ;
List ( "January" ; "February" ; "March" ; "April" ; "May" ; "June" ; "July" ; "August" ; "September" ; "October" ; "November" ; "December" ) ;
List ( "janvier" ; "février" ; "Mars" ; "avril" ; "mai" ; "juin" ; "juillet" ; "août" ; "septembre" ; "octobre" ; "novembre" ; "décembre" )
) ;

dn = Case ( language = "EN" ;
List ( "Sunday" ; "Monday" ; "Tuesday" ; "Wednesday" ; "Thursday" ; "Friday" ; "Saturday" ) ;
List ( "Dimanche" ; "Lundi" ; "Mardi" ; "Mercredi" ; "Jeudi" ; "Vendredi" ; "Samedi" )
) ;

do = Max ( 0 ; dayOption ) ;
yDisplay = Case ( IsEmpty ( yearOption ) ; " " & y ) ;
dn = GetValue ( dn ; dow ) ;

mnD = GetValue ( mn ; m ) ;
mnYD = ", " & mnD & " " & d & yDisplay

] ;

Choose ( do ;
mnD & yDisplay ;
dn & mnYD ;
TextStyleAdd ( dn ; Uppercase ) & mnYD ;
TextStyleAdd ( dn ; Bold ) & mnYD ;
TextStyleAdd ( dn ; Uppercase + Bold ) &

eos, Teg
December 12, 2014 2:11pm

Thanks so much for your observations and suggestions Teg.

I've already integrated some of those in v.2 of my CF (and fixed the incorrect example) as you can see. I'm leaving the calc part of the CF as is for now but will certainly run some tests using you suggested CF which is indeed less convoluted.

Thanks Again,

François

François Goulet, Montreal, QC Canada
December 12, 2014 6:40pm

Thanks Teg for improving.

Small correction needed : "Mars" in the French months list must be written without capital : "mars".

Bernard Moreau, Borchtlombeek - Belgium
December 13, 2014 3:27am

OUPS! Correction made...

Merci et bonne journée Bernard.

François Goulet, Montreal, QC Canada
December 13, 2014 5:06am

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 7 + 3 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. decFromHex ( hexValue )
  (Mon, Oct 16, 12:34pm)
2. MonthYearList ( startmonth ; startyear ; numbermonth ; short )
  (Mon, Oct 16, 3:38am)
3. ErrorDescription ( errorNumber )
  (Wed, Sep 27, 2:51am)
4. decodeEntities (text)
  (Wed, Sep 27, 1:22am)
5. HexidecimalToNumber ( HexidecimalValue ; counter )
  (Mon, Sep 25, 12:39pm)
6. FixedFieldConverter ( Fieldname ; f1 ; f2 ; f3 ; f4 ; f5 ; f6 ; f7 ; f8 ; f9 ; f10 ; f11 ; f12 ; f13 ; f14 ; f15 ; f16 ; f17 ; f18 ; f1
  (Fri, Sep 15, 12:34pm)
7. ShannonEntropy ( text )
  (Thu, Sep 07, 5:59am)
8. LetterCount ( text ; summary )
  (Thu, Sep 07, 5:53am)

RSS Feed of Custom Functions