home contribute faq download

FunctX XSLT Functions

functx:month-abbrev-en

The month of a date as an abbreviated word (Jan, Feb, etc.)

Google
Webxsltfunctions.com

Description

The functx:month-abbrev-en function returns the month of $date as an abbreviated xs:string in English, as in "Jan", "Feb", etc.

The $date argument must be castable to xs:date, meaning that it must have the type xs:date or xs:dateTime, or be an xs:string or untyped value of the form YYYY-MM-DD.

Arguments and Return Type

NameTypeDescription
$date xs:anyAtomicType? the date
return value xs:string?

XSLT Function Declaration

See XQuery definition.
<xsl:function name="functx:month-abbrev-en" as="xs:string?"
              xmlns:functx="http://www.functx.com">
  <xsl:param name="date" as="xs:anyAtomicType?"/>

  <xsl:sequence select="
   ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
    'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')
    [month-from-date(xs:date($date))]
 "/>

</xsl:function>

Examples

XPath ExampleResults
functx:month-abbrev-en(xs:date('2004-01-23'))
Jan
functx:month-abbrev-en(
     xs:dateTime('2004-01-23T12:00:13'))
Jan
functx:month-abbrev-en('2004-01-23')
Jan

See Also

functx:month-name-enThe month of a date as a word (January, February, etc.)
fn:month-from-dateThe month portion of a date
fn:month-from-dateTimeThe month portion of a date/time

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, http://www.datypic.com
Datypic XSLT Services

Recommended Reading:

XQuery