Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I don't know how to write this if sentence ... if date now between start and end date
Like there:
<xsl:if test="Exslt.ExsltDatesAndTimes:datetime()>./data [@alias='quiz_startdate'] and Exslt.ExsltDatesAndTimes:datetime()<./data [@alias='quiz_endDate'] ">Please someone help me !
Hi Andres,
There's a useful helper method in umbraco.library for this kind of thing:
<xsl:variable name="startDate" select="data[@alias = 'quiz_startdate']" /> <xsl:variable name="endDate" select="data[@alias = 'quiz_endDate']" /> <xsl:if test="umbraco.library:DateGreaterThanToday($endDate) and not(umbraco.library:DateGreaterThanToday($startDate))"> <!-- do stuff --> </xsl:if>
(Dates in XML are just strings and you can't do comparisons like these on them, so need some extensions)
/Chriztian
Great ! it works :D
Thank you very much
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
XSLT if date now between start and end date trouble...
I don't know how to write this if sentence ... if date now between start and end date
Like there:
<xsl:if test="Exslt.ExsltDatesAndTimes:datetime()>./data [@alias='quiz_startdate'] and Exslt.ExsltDatesAndTimes:datetime()<./data [@alias='quiz_endDate'] ">
Please someone help me !
Hi Andres,
There's a useful helper method in umbraco.library for this kind of thing:
<xsl:variable name="startDate" select="data[@alias = 'quiz_startdate']" /> <xsl:variable name="endDate" select="data[@alias = 'quiz_endDate']" /> <xsl:if test="umbraco.library:DateGreaterThanToday($endDate) and not(umbraco.library:DateGreaterThanToday($startDate))"> <!-- do stuff --> </xsl:if>
(Dates in XML are just strings and you can't do comparisons like these on them, so need some extensions)
/Chriztian
Great ! it works :D
Thank you very much
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.