Re: [basex-talk] Converting a Date

2018-11-06 Thread Ron Katriel
Perfect. As always appreciate the great support and quick turnaround! Best, Ron > On Nov 6, 2018, at 3:56 AM, Christian Grün wrote: > > We are working on a web site, which will facilitate the management of > new external modules for BaseX. Users are expected to be able to > upload new modules,

Re: [basex-talk] Converting a Date

2018-11-06 Thread Christian Grün
We are working on a web site, which will facilitate the management of new external modules for BaseX. Users are expected to be able to upload new modules, search for existing modules and install them in local BaseX instances with a few clicks. This module will definitely be a good candidate for thi

Re: [basex-talk] Converting a Date

2018-11-05 Thread Ron Katriel
Hi Andy, Thanks for the quick solution! I imported the new module and was able to use the new function as follows: xs:date(dates:parseDate($trial/completion_date)//value/text()) <= fn:current-date() I verified the correctness for ~300 dates and the logic appears solid (for the kind of dates disc

Re: [basex-talk] Converting a Date

2018-11-05 Thread Andy Bunce
Hi Ron, I took a quick look at Joe's module and made the following changes: 1. Change datetime:format-date(..,"-MM-dd") to format-date(..,"[]-[MM]-[DD]") 2. *Change xdt*:dayTimeDuration("P1D") -> *xs*:dayTimeDuration 3. Change function in namespace *local:* to *dates:* And sa

Re: [basex-talk] Converting a Date

2018-11-04 Thread Ron Katriel
Hi Joe, Thanks for sharing that. I tried adapting your eXist port to BaseX and ran into issues with namespaces. At this point I don’t have the time or expertise to complete this but hopefully someone else will take up the challenge. Best, Ron On November 3, 2018 at 12:19:49 AM, Joe Wicentowski (

Re: [basex-talk] Converting a Date

2018-11-02 Thread Joe Wicentowski
Hi Ron, You might find Ryan Grimm's date-parser library module useful if you have a larger range of date formats to handle: https://github.com/marklogic-community/commons/blob/master/dates/date-parser.xqy While it was written with some MarkLogic-specific code, I adapted it for use with eXist (b

Re: [basex-talk] Converting a Date

2018-11-02 Thread Ron Katriel
Hi Christian, Much appreciated! I hardened the code (see below) since the dates (from CT.gov) occasionally also have the day of the month (e.g., “March 21, 2014”). Currently the function is dropping the day in such cases but I will look into capturing it in a future iteration. Best, Ron declare

Re: [basex-talk] Converting a Date

2018-11-02 Thread Christian Grün
Hi Ron, If your timestamp is available in IETF format, you can use fn:parse-ietf-date [1]. Otherwise, you’ll need to write a simple function by yourself: declare variable $MONTHS := ( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'Nove

[basex-talk] Converting a Date

2018-11-02 Thread Ron Katriel
Hi, Is there a BaseX function for converting a string date in the form of “March 2017” to xs:date or xs:dateTime? Thanks, Ron On November 2, 2018 at 2:37:31 PM, Imsieke, Gerrit, le-tex ( gerrit.imsi...@le-tex.de) wrote: One approach to avoid migration and backwards compatibility issues would be