You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's an error on the demo for <pb-browse-docs> ("passing parameters from a custom form") when one tries to sort the list by "modification date" . The French dialog is "Erreur d’exécution de la requête.: undefined".
the value is 'default' but should be a date of some sort I guess.
On a standalone app, I was able to get it running, but I wasn't able to get a proper date sort (even though I defined the date option as an xs:date in the index.xql...
Ex. :
case "date" return
xs:date($header//tei:sourceDesc/(tei:bibl|tei:biblFull)/tei:date/@when)
The text was updated successfully, but these errors were encountered:
I finally did more testing and must correct the previous post.
The error comes from the fact that the value indexed is not a xs:date (or at least a "yyyy-mm-dd" date). "yyyy" or "yyyy-mm" will fail in nav:sort, hence the error message.
Concerning the demo, maybe the indexed value may be checked?
As a dates in @when can be formatted as "yyyy" or "yyyy-mm" as well as "yyyy-mm-dd", this response may not be understood by the user.
To prevent it in my standalone webapp, I just add the following function in index.xql.
declare function idx:formatDate($input as xs:string?) as xs:date? {
if(empty($input))
then ()
else
let $i := normalize-space(replace($input, ' ', ' '))
let $date := if (matches($i,'^(\d{4}-\d{2}-\d{2}).*'))
then xs:date($i)
else if (matches($i,'^(\d{4})$')) then xs:date($i || '-01-01')
else if (matches($i,'^(\d{4}-\d{2})$')) then xs:date($i || '-01')
else ()
return $date
};
Will work only for @when, and there may be stronger ways to handle that.
There's an error on the demo for
<pb-browse-docs>
("passing parameters from a custom form") when one tries to sort the list by "modification date" . The French dialog is "Erreur d’exécution de la requête.: undefined".See https://unpkg.com/@teipublisher/[email protected]/dist/api.html#pb-browse-docs.2
I might think it comes from the .html, where the sort options are listed.
sort-options='[{"label": "browse.title", "value": "title"},{"label": "browse.author", "value": "author"},{"label": "browse.modificationDate", "value": "default"}]'
the value is 'default' but should be a date of some sort I guess.
On a standalone app, I was able to get it running, but I wasn't able to get a proper date sort (even though I defined the date option as an xs:date in the index.xql...
Ex. :
The text was updated successfully, but these errors were encountered: