Skip to content

Commit

Permalink
improve regex
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Aug 23, 2022
1 parent 6e7e780 commit a123135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xquery/date.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ declare function date:format-date($date as xs:date, $picture as xs:string, $lang
declare function date:printDate($date as element()?, $lang as xs:string, $get-language-string as function(xs:string, xs:string*, xs:string) as xs:string, $get-picture-string as function(xs:string) as xs:string) as xs:string? {
if($date) then (
let $picture-string := $get-picture-string($lang) (: if($lang = 'de') then '[D1o] [MNn] [Y]' else '[MNn] [D], [Y]':)
let $picture-string-day := replace($picture-string, '\[M[^\]]*\]|\[Y[^\]]*\]', '') (: strip off month and year specifier from the picture string :)
let $picture-string-day := replace($picture-string, '\[M[^\]]*\]|(,\s)?\[Y[^\]]*\]', '') => normalize-space() (: strip off month and year specifier from the picture string :)
let $notBefore := if($date/@notBefore) then date:getCastableDate(data($date/@notBefore),false())
else if($date/@notBefore-iso) then date:getCastableDate(data($date/@notBefore-iso),false())
else()
Expand Down

0 comments on commit a123135

Please sign in to comment.