CFLib.org – Common Function Library Project

monthAbbrev(monthNum)

Last updated February 7, 2013

author

Craig Heath

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Pass in a digit (1-12) and get back the equivalent three character calendar month abbreviation.

Return Values:
Returns a locale-specific string representation of the month formatted with mask mmm

Example:

<cfoutput>
	<cfloop from="1" to="12" index="m">
		monthAbbrev(#m#): #monthAbbrev(m)#<br />
	</cfloop>
</cfoutput>

Parameters:

Name Description Required
monthNum The month (1-12) Yes

Full UDF Source:

/**
 * Month number to three character month text abbreviation.
 * v0.9 by Craig Heath
 * v1.0 by Adam Cameron (improved/simplified logic, made locale-aware)
 * 
 * @param monthNum 	 The month (1-12) (Required)
 * @return Returns a locale-specific string representation of the month formatted with mask mmm 
 * @author Craig Heath (cf.contractor@gmail.com) 
 * @version 1.0, February 7, 2013 
 */
function monthAbbrev(monthnum) {
	return lsDateFormat("01-#monthnum#-01", "mmm"); // the year and the date are insignificant
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson