You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/07/22 18:27:00 UTC

[jira] [Commented] (SLING-9983) Add support for predefined date format styles

    [ https://issues.apache.org/jira/browse/SLING-9983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17385705#comment-17385705 ] 

Konrad Windszus commented on SLING-9983:
----------------------------------------

I documented this now in [https://sling.apache.org/documentation/bundles/scripting/scripting-htl.html|https://sling.apache.org/documentation/bundles/scripting/scripting-htl.html.] with https://github.com/apache/sling-site/commit/1c2d8478ae9e7565bf8d791f0f9f89e5373d03fe.

> Add support for predefined date format styles
> ---------------------------------------------
>
>                 Key: SLING-9983
>                 URL: https://issues.apache.org/jira/browse/SLING-9983
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>    Affects Versions: Scripting HTL Engine 1.4.6-1.4.0
>            Reporter: Konrad Windszus
>            Assignee: Radu Cotescu
>            Priority: Major
>             Fix For: Scripting HTL Testing 1.0.30-1.4.0, Scripting HTL Engine 1.4.8-1.4.0, Scripting HTL Testing Content 1.0.28-1.4.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> SLING-6399 introduced possibilities to format dates as mandated by the spec: https://github.com/adobe/htl-spec/blob/1.3/SPECIFICATION.md#122-format.
> The problem is that date patterns patterns in general (even if a locale is passed) differ a lot between countries and languages. For that reason Java defines some [standard formats |https://docs.oracle.com/javase/tutorial/i18n/format/dateFormat.html] which work for all languages/countries. The special strings "DEFAULT", "SHORT", "MEDIUM", "LONG", and "FULL" should be accepted as values which should lead to using https://docs.oracle.com/javase/8/docs/api/java/text/DateFormat.html#getDateInstance-int-java.util.Locale- as formatter. They are also defined by Unicode CLDR: http://cldr.unicode.org/translation/date-time-1/date-time-patterns#TOC-Basic-Date-Formats



--
This message was sent by Atlassian Jira
(v8.3.4#803005)