1

4月6日からの年に基づいて年を計算しようとしています。

EXSLTを使用すると、通常の1月の開始に基づいて年を取得できます。

date:formatDate(date:add(date:date(), '-P6Y'), 'yyyy')

どうすれば同じことができますが、4月6日から1年間です。

ありがとう。

4

1 に答える 1

0

このようなもの

 <xsl:choose>
   <xsl:when test="(date:month-in-year() = 4 and date:day-in-month() <= 6) or (date:month-in-year() < 4)">
     <xsl:value-of select="date:formatDate(date:add(date:date(), '-P7Y'), 'yyyy')" />
   </xsl:when>
   <xsl:otherwise>
     <xsl:value-of select="date:formatDate(date:add(date:date(), '-P6Y'), 'yyyy')" />
  </xsl:otherwise>
</xsl:choose>
于 2010-01-17T23:30:37.460 に答える