Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
XPath for checking date is in current fiscal year
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