Created
August 3, 2020 17:55
-
-
Save avernet/7b9c399fb9d03655d10e976cff0db0f5 to your computer and use it in GitHub Desktop.
XPath for checking date is in current fiscal year
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
$this-year-start := xs:date(concat(year-from-date(current-date()), '-07-01')), | |
$fiscal-start := | |
if ($this-year-start <= current-date()) | |
then $this-year-start | |
else $this-year-start - xs:yearMonthDuration('P1Y'), | |
$fiscal-end := $fiscal-start + xs:yearMonthDuration('P1Y') - xs:dayTimeDuration('P1D'), | |
$input-date := xs:date('2020-08-03') | |
return | |
$fiscal-start <= $input-date and | |
$input-date <= $fiscal-end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment