xsl-list
[Top] [All Lists]

RE: [xsl] producing month list in xslt 2.0

2006-07-28 14:35:49

<xsl:variable name="one-month" as="xs:yearMonthDuration" 
              select="xs:yearMonthDuration('P1M')"/>

<xsl:for-each select="0 to 11">
  <xsl:variable name="month" 
     select="month-from-year(current-date() + . * $one-month)"/>

Michael Kay
http://www.saxonica.com
 

-----Original Message-----
From: David Murphy [mailto:david(_at_)firechaser(_dot_)com] 
Sent: 28 July 2006 16:54
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] producing month list in xslt 2.0

Hello

I'd like to be able to display the next 12 months for use in 
a calendar application.

What I have so far:

<xsl:param name="thisMonth"  select="xs:date(format-date(xs:date($m),
'[Y]-[M01]-01'))"/>

<xsl:param name="lastMonth"  select="$thisMonth - 
xdt:yearMonthDuration('P1M')"/>

<xsl:param name="nextMonth"  select="$thisMonth + 
xdt:yearMonthDuration('P1M')"/>

Is there a way to loop through the next or previous 12 months 
(wrt the current focus month, $thisMonth) using the built-in 
date time functions, or am I required to call a counter 
template to loop from 1 to 12?

Thanks for any guidance, David

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>