I need to get 3 days before and after a given date defined in a variable, and store each one of them in a new individual variable in xsl 1.0. i can't use any extensions or third party tools.
Looking trough the answers in the forums, i found this: Expanding datetime ranges in XSLT 1.0 for a similar problem, but i dont fully understand if and how it would aply to my code.
Mi date variable is in standard dateTime format, like this:
<xsl:variable name="Date" select="2014-05-13T00:00:00"/>
And i would need to output an html similar to this:
<table>
<tr>
<td>
2014-05-10
<td>
</tr>
<!---some rows with pricing information -->
</table>
<table>
<tr>
<td>
2014-05-11
<td>
</tr>
<!---some rows with pricing information -->
</table>
<table>
<tr>
<td>
2014-05-12
<td>
</tr>
<!---some rows with pricing information -->
</table>
<!-- etc -->
In the rows with pricing information I will have to use each individual date to perform other operations, so each day must be stored in a variable for further use.
Is there a way to accomplish this, using just xslt 1.0?
Thanks in advance.
addOneToDate
template from the code you linked. It calculates the day, month and year after adding one day. Add aparam
to pass the days you want to add/remove, and adapt the expressions using the parameter as a variable to calculate the correct day, year and month. – Koren