Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WeGA-WebApp-lib
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
busoni-schriften
WeGA-WebApp-lib
Commits
54f65403
Commit
54f65403
authored
6 years ago
by
Christian Schaper
Browse files
Options
Downloads
Patches
Plain Diff
support gMonthDay, gDay
parent
a2be1e6e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xquery/date.xqm
+6
-0
6 additions, 0 deletions
xquery/date.xqm
with
6 additions
and
0 deletions
xquery/date.xqm
+
6
−
0
View file @
54f65403
...
...
@@ -51,6 +51,8 @@ declare %private function date:getCastableDate($date as xs:string, $latest as xs
else
if
(
$date
castable
as
xs:gYearMonth
)
then
if
(
$latest
)
then
xs:date
(
concat
(
$date
,
'-'
,
functx:days-in-month
(
xs:date
(
concat
(
$date
,
'-01'
)))))
else
xs:date
(
concat
(
$date
,
'-01'
))
else
if
(
$date
castable
as
xs:gMonthDay
)
then
xs:date
(
concat
(
'9999-'
,
substring-after
(
$date
,
'--'
)))
else
if
(
$date
castable
as
xs:gDay
)
then
xs:date
(
concat
(
'9999-12-'
,
substring-after
(
$date
,
'---'
)))
else
()
};
...
...
@@ -137,6 +139,8 @@ declare function date:printDate($date as element()?, $lang as xs:string, $get-la
if
(
$date
/
@when
castable
as
xs:date
)
then
date:format-date
(
$date
/
@when
,
$picture-string
,
$lang
)
else
if
(
$date
/
@when
castable
as
xs:gYear
)
then
date:formatYear
(
$date
/
@when
,
$lang
)
else
if
(
$date
/
@when
castable
as
xs:gYearMonth
)
then
date:format-date
(
date:getCastableDate
(
data
(
$date
/
@when
)
,
true
())
,
'[MNn] [Y]'
,
$lang
)
else
if
(
$date
/
@when
castable
as
xs:gMonthDay
)
then
$get-language-string
(
'noYear'
,
xs:string
(
date:format-date
(
date:getCastableDate
(
data
(
$date
/
@when
)
,
true
())
,
'[D]. [MNn]'
,
$lang
)))
else
if
(
$date
/
@when
castable
as
xs:gDay
)
then
$get-language-string
(
'noYearMonth'
,
xs:string
(
date:format-date
(
date:getCastableDate
(
data
(
$date
/
@when
)
,
true
())
,
'[D].'
,
$lang
)))
else
if
(
$date
/
@when
castable
as
xs:dateTime
)
then
date:format-date
(
datetime:date-from-dateTime
(
$date
/
@when
)
,
$picture-string
,
$lang
)
else
error
(
$date:DATE_FORMAT_ERROR
,
'unsupported value for @when: "'
||
$date
/
@when
||
'".'
)
(: @when-iso für die busoni-app :)
...
...
@@ -144,6 +148,8 @@ declare function date:printDate($date as element()?, $lang as xs:string, $get-la
if
(
$date
/
@when-iso
castable
as
xs:date
)
then
date:format-date
(
$date
/
@when-iso
,
$picture-string
,
$lang
)
else
if
(
$date
/
@when-iso
castable
as
xs:gYear
)
then
date:formatYear
(
$date
/
@when-iso
,
$lang
)
else
if
(
$date
/
@when-iso
castable
as
xs:gYearMonth
)
then
date:format-date
(
date:getCastableDate
(
data
(
$date
/
@when-iso
)
,
true
())
,
'[MNn] [Y]'
,
$lang
)
else
if
(
$date
/
@when-iso
castable
as
xs:gMonthDay
)
then
$get-language-string
(
'noYear'
,
xs:string
(
date:format-date
(
date:getCastableDate
(
data
(
$date
/
@when-iso
)
,
true
())
,
'[D]. [MNn]'
,
$lang
)))
else
if
(
$date
/
@when-iso
castable
as
xs:gDay
)
then
$get-language-string
(
'noYearMonth'
,
xs:string
(
date:format-date
(
date:getCastableDate
(
data
(
$date
/
@when-iso
)
,
true
())
,
'[D].'
,
$lang
)))
else
if
(
$date
/
@when-iso
castable
as
xs:dateTime
)
then
date:format-date
(
datetime:date-from-dateTime
(
$date
/
@when-iso
)
,
$picture-string
,
$lang
)
else
error
(
$date:DATE_FORMAT_ERROR
,
'unsupported value for @when-iso: "'
||
$date
/
@when-iso
||
'".'
)
else
if
(
exists
(
$notBefore
))
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment