VerboseDate ( )

Function stats

Average user rating
74
158
9999
Support
FileMaker 7.0 +
Date posted
21 December 2008
Last updated
22 December 2008
Version
Recursive function
No

Author Info
 Ken Newell

3 functions

Average Rating None

author_avatar



 

Function overview

Prototype

VerboseDate  ( TheDate )


Parameters

TheDate  


Description

Tags:  Layout   Date  

Enter a date and a text version will be returned. For example: 12/20/2008 returns December Twelfth of 2008. Function would need to be localized for languages other than English.

Examples

Sample input

VerboseDate ( GetAsDate ( "12/20/2008" )


Sample output

Twelfth of December 2008

 

Function code

/*
==================================================
03/14/2005 1.0 KLN Original Version
12/21/2008 2.0 KLN Modified From Case Statement To Choose
==================================================
PURPOSE: To return a text string spelling out the date for use on a certificate or
award. For example March Fourteenth Of 2005
==================================================
USER INPUTS
TestDate = The Date field in the Current Table To Find Closest To

VAIRABLES
None

OTHER CUSTOM FUNCTIONS USED
None

ACKNOWLEDGEMENTS
Daniele Raybaudi posted on www.fmfunctions.com a comment to the original
function to arrive at 2.0. Simplier and easier to read. Thanks.
==================================================
*/
Choose( Day( TheDate ) ;"";
"First";
"Second";
"Third";
"Fourth";
"Fifth";
"Sixth";
"Seventh";
"Eighth";
"Ninth";
"Tenth";
"Eleventh";
"Twelfth";
"Thirteenth";
"Fourteenth";
"Fifteenth";
"Sixteenth";
"Seventeenth";
"Eighteenth";
"Nineteenth";
"Twentieth";
"Twenty-first";
"Twenty-second";
"Twenty-third";
"Twenty-fourth";
"Twenty-fifth";
"Twenty-sixth";
"Twenty-seventh";
"Twenty-eighth";
"Twenty-ninth";
"Thirtieth";
"Thirty-first"
)
& " of " & MonthName( TheDate ) & " " & Year( TheDate )

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/158

    Prototype: VerboseDate( TheDate )
    Function Author: Ken Newell (http://www.fmfunctions.com/mid/74)
    Last updated: 22 December 2008
    Version: 2.1

*/
// ===================================

 

Comments

Daniele Raybaudi
21 December 2008



Hi Ken

1) Isn't [ " of " & MonthName( TheDate ) & " " & Year( TheDate ) ] a fix partial result for all cases ?
So to justify something like:

Case(
x = 1 ; y ;
x = 2 ; z
)
& " of " & MonthName( TheDate ) & " " & Year( TheDate )

2) Isn't better the Choose ( ) function instead of Case ( ) ?

Choose( Day( TheDate ) ;"";
"First";
"Second";
"Third";
"Fourth";
"Fifth";
"Sixth";
"Seventh";
"Eighth";
"Ninth";
"Tenth";
"Eleventh";
"Twelfth";
"Thirteenth";
"Fourteenth";
"Fifteenth";
"Sixteenth";
"Seventeenth";
"Eighteenth";
"Nineteenth";
"Twentieth";
"Twenty-first";
"Twenty-second";
"Twenty-third";
"Twenty-fourth";
"Twenty-fifth";
"Twenty-sixth";
"Twenty-seventh";
"Twenty-eighth";
"Twenty-ninth";
"Thirtieth";
"Thirty-first"
)
& " of " & MonthName( TheDate ) & " " & Year( TheDate )
(Edited by Daniele Raybaudi on 21/12/08 )
  General comment
Ken Newell
22 December 2008



Daniele,

Yes your improvements to the Function would shorten it up and make it easier to read. I found this in my pile of old stuff from 3 years ago and posted it without looking to see if I could improve it. I often forget about the choose command which is a perfect fit here. Thanks for the suggestion.
  General comment
Ken Newell
22 December 2008



Function has been updated to Daniele's version which is shorter and easier to read. The result returned has not changed.
  General comment
Daniele Raybaudi
22 December 2008



Ken

thanks to accept my suggestion.

There are 3 more:

1) the result of the function is different from what you say in the documentation and in the "Sample output"

2) this function may work only for English people

3) An ipotetic Ordinal ( number ) CF could simplify more your CF ( and even make it obsolete ) because the final calc will be:

Ordinal( Day( TheDate ) ) & " of " & MonthName( TheDate ) & " " & Year( TheDate )
  General comment
The Shadow
22 December 2008



I have one that just converts integers to strings, called ConvertSmallIntToWords:
http://www.fmfunctions.com/fid/127

  General comment

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)