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
*/
// ===================================
/*__LITBR__==================================================__LITBR__ 03/14/2005 1.0 KLN Original Version__LITBR__ 12/21/2008 2.0 KLN Modified From Case Statement To Choose__LITBR__==================================================__LITBR__PURPOSE: To return a text string spelling out the date for use on a certificate or__LITBR__award. For example March Fourteenth Of 2005__LITBR__==================================================__LITBR__USER INPUTS__LITBR__ TestDate = The Date field in the Current Table To Find Closest To__LITBR____LITBR__VAIRABLES__LITBR__ None__LITBR____LITBR__OTHER CUSTOM FUNCTIONS USED__LITBR__ None__LITBR____LITBR__ACKNOWLEDGEMENTS__LITBR__ Daniele Raybaudi posted on www.fmfunctions.com a comment to the original__LITBR__ function to arrive at 2.0. Simplier and easier to read. Thanks.__LITBR__==================================================__LITBR__ */__LITBR__Choose( Day( TheDate ) ;"";__LITBR__"First";__LITBR__"Second";__LITBR__"Third";__LITBR__"Fourth";__LITBR__"Fifth";__LITBR__"Sixth";__LITBR__"Seventh";__LITBR__"Eighth";__LITBR__"Ninth";__LITBR__"Tenth";__LITBR__"Eleventh";__LITBR__"Twelfth";__LITBR__"Thirteenth";__LITBR__"Fourteenth";__LITBR__"Fifteenth";__LITBR__"Sixteenth";__LITBR__"Seventeenth";__LITBR__"Eighteenth";__LITBR__"Nineteenth";__LITBR__"Twentieth";__LITBR__"Twenty-first";__LITBR__"Twenty-second";__LITBR__"Twenty-third";__LITBR__"Twenty-fourth";__LITBR__"Twenty-fifth";__LITBR__"Twenty-sixth";__LITBR__"Twenty-seventh";__LITBR__"Twenty-eighth";__LITBR__"Twenty-ninth";__LITBR__"Thirtieth";__LITBR__"Thirty-first"__LITBR__)__LITBR__& " of " & MonthName( TheDate ) & " " & Year( TheDate )__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/158__LITBR____LITBR__ Prototype: VerboseDate( TheDate )__LITBR__ Function Author: Ken Newell (http://www.fmfunctions.com/mid/74)__LITBR__ Last updated: 22 December 2008__LITBR__ Version: 2.1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
21 December 2008
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 )
22 December 2008
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.
22 December 2008
22 December 2008
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 )
22 December 2008
http://www.fmfunctions.com/fid/127