EXSLT - date:week-in-year - Implementer Page

Version: 3
Status: implemented
User Page: index.html
XML Definition: date.week-in-year.xml
Function Package: date.week-in-year.zip

Function Syntax

number date:week-in-year(string?)

Template Syntax

<xsl:call-template name="date:week-in-year">
   <xsl:with-param name="date-time" select="string" />?
</xsl:call-template>

The date:week-in-year function returns the week of the year as a number. If no argument is given, then the current local date/time, as returned by date:date-time is used as the default argument. For the purposes of numbering, counting follows ISO 8601: week 1 in a year is the week containing the first Thursday of the year, with new weeks beginning on a Monday.

The date/time string specified as the argument is a right-truncated string in the format defined as the lexical representation of xs:dateTime in one of the formats defined in [XML Schema Part 2: Datatypes]. The permitted formats are as follows:

If the date/time string is not in one of these formats, then NaN is returned.

An implementation of this extension function in the EXSLT date namespace must conform to the behaviour described in this document.

Implementations

Built-in support for date:week-in-year is available in the following XSLT processors:

ProcessorProcessor VersionImplemented Version
SAXON from Michael Kay6.4.23
Xalan-J from Apache2.4.D13
4XSLT, from 4Suite.0.12.0a33
libxslt from Daniel Veillard et al.1.0.193

The following implementations of date:week-in-year are available:

LanguageImplemented VersionCreatorDateDownload
EXSLT Function3Jeni Tennison2001-07-20date.week-in-year.function.xsl
XSLT Template3Jeni Tennison2001-07-20date.week-in-year.template.xsl
Javascript2Chris Bayes2001-06-11date.js
Msxsl2Chris Bayes2001-06-16date.msxsl.xsl

Change History

Previous Version: date.week-in-year.2.html

VersionModifiedByDetails
32001-07-20Jeni Tennison
  • Fixed week numbering to tie in with ISO 8601.
  • Added vendor implementation in Saxon 6.4.2
3.12002-08-21Craig Stewart

Added Xalan-J, libxslt and 4XSLT implementation to the list.

3.22002-11-12Craig Stewart

Updated 4XSLT version to 0.12.0a3.

http://www.exslt.org/date/functions/week-in-year/date.week-in-year.html last modified 2002-11-12