[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16209234#comment-16209234 ] ASF GitHub Bot commented on SLING-7185: --- Github user asfgit closed the pull request at: https://github.com/apache/sling/pull/261 > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement > Components: JCR >Affects Versions: JCR Content Parser 1.2.4 >Reporter: Jason E Bailey >Assignee: Stefan Seifert >Priority: Minor > Fix For: JCR Content Parser 1.2.6 > > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16207739#comment-16207739 ] ASF GitHub Bot commented on SLING-7185: --- GitHub user JEBailey opened a pull request: https://github.com/apache/sling/pull/261 SLING-7185 Added support for ISO8601 parsing Parsing is of a relatively strict format, requiring date time and offset. milliseconds to 3 decimals. You can merge this pull request into a Git repository by running: $ git pull https://github.com/JEBailey/sling SLING-7185 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/sling/pull/261.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #261 commit 3ee6e6bface752e30eeffc6b4f61029c5968c040 Author: JE BaileyDate: 2017-10-17T01:18:24Z SLING-7185 Added support for ISO8601 parsing Parsing is of a relatively strict format, requiring date time and offset. milliseconds to 3 decimals. > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16207713#comment-16207713 ] ASF GitHub Bot commented on SLING-7185: --- Github user JEBailey closed the pull request at: https://github.com/apache/sling/pull/260 > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16207497#comment-16207497 ] Jason E Bailey commented on SLING-7185: --- Kept it Java 7 based, thanks for pointing out the IS08601 class from jackrabbit. It's a lot easier to use compared to what's in Java 8. Although it is more strict from an input point of view. > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16207276#comment-16207276 ] ASF GitHub Bot commented on SLING-7185: --- GitHub user JEBailey opened a pull request: https://github.com/apache/sling/pull/260 SLING-7185 Added support for ISO8601 parsing Parsing is of a relatively strict format, requiring date, time, and offset. Milliseconds to 3 decimals are required. You can merge this pull request into a Git repository by running: $ git pull https://github.com/JEBailey/sling SLING-7185 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/sling/pull/260.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #260 commit 7cc03f0c0f4aa3cbeb3374def246905cb398d19c Author: JE BaileyDate: 2017-10-17T01:18:24Z SLING-7185 Added support for ISO8601 parsing Parsing is of a relatively strict format, requiring date time and offset. milliseconds to 3 decimals. > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16206548#comment-16206548 ] Stefan Seifert commented on SLING-7185: --- i would prefer still supporting Java 7. jackrabbit has a class for this as well: http://jackrabbit.apache.org/api/2.8/org/apache/jackrabbit/util/ISO8601.html > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16206504#comment-16206504 ] Jason E Bailey commented on SLING-7185: --- Would it be a problem to update the Content Parser to require Java 8 as part of this? I'm looking at using the java.time package to handle the parsing. If so, all I would need to do is update the parent version number in the POM, correct? > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16206244#comment-16206244 ] Stefan Seifert commented on SLING-7185: --- in minor problem is of course that in case of JSON parsing the date is tried with each and every string because it's not known if it's a date (date parsing can be switched off in general in the options). putting those two in cascade will double the try-parse actions. but making this more performant would be a separate task - if this is a real problem at all. > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16206243#comment-16206243 ] Stefan Seifert commented on SLING-7185: --- cascade should be fine, and perhaps try ISO-8601 first and then fallback to the sling get-style > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16206179#comment-16206179 ] Jason E Bailey commented on SLING-7185: --- So is your thinking a configurable formatting or a cascade? I can go ahead and implement the cascade handling of formatting if that's acceptable. > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16205783#comment-16205783 ] Stefan Seifert commented on SLING-7185: --- it would definitely make sense to support other (and more common) date formats as well to the content parser. to allow export-import roundtrips of JSON with the sling get servlet we added support for the date format used by it first, but other formats make sense as well. > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (SLING-7185) Content Parser: Support for ISO-8601
[ https://issues.apache.org/jira/browse/SLING-7185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16203851#comment-16203851 ] Jason E Bailey commented on SLING-7185: --- I found the formatting for the date to be odd and specific since Sling is specifically looking for a specific date format in a US locale formatting. Then it was brought to my attention that Sling is exporting the date field in this format as well. So my assumptions at this point is that the main focus of JSON output was to create JSON specifically for browsers and at *that* point in time the formatting of dates in javascript was the US focused format currently being used by Sling Notes: * JavaScript has supported an ISO8601 subset since EcmaScript 5.1 * In JavaScript the default implementation of Date.toJSON() is an ISO8601 string. see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toJSON * ISO8601 is the standard for String representations of dates. see https://xkcd.com/1179/ Would there be support in adding this to the Content Parser? > Content Parser: Support for ISO-8601 > > > Key: SLING-7185 > URL: https://issues.apache.org/jira/browse/SLING-7185 > Project: Sling > Issue Type: Improvement >Reporter: Jason E Bailey >Priority: Minor > > The class org.apache.sling.jcr.contentparser.impl.ParserHelper defines the > Json format for a date to a defined value of ECMA_DATE_FORMAT. > Please support ISO-8601 as a date format. -- This message was sent by Atlassian JIRA (v6.4.14#64029)