Created
May 19, 2015 01:17
-
-
Save wcandillon/7cfb8f010cdde973064e to your computer and use it in GitHub Desktop.
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
declare function local:is_in_date_range($index_entry, $date_filter) { | |
let $now := if ($date_filter!='') | |
then $date_filter | |
else current-date() - xs:dayTimeDuration(concat('P',14,'D')) | |
return | |
let $results := | |
for $program in $index_entry/program | |
return | |
if (not($program/@end_dt castable as xs:date)) | |
then true() | |
else if (xs:date($now) > xs:date($program/@end_dt)) | |
then false() | |
else true() | |
return | |
every $result in $results | |
satisfies $result eq true() | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment