You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2021/07/22 20:58:51 UTC

[sling-site] branch master updated: some more clarification on HTL date formatting

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 9636e53  some more clarification on HTL date formatting
9636e53 is described below

commit 9636e53123c15727035e2c3e48493053e851b348
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Jul 22 22:58:41 2021 +0200

    some more clarification on HTL date formatting
---
 .../content/documentation/bundles/scripting/scripting-htl.md   | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/main/jbake/content/documentation/bundles/scripting/scripting-htl.md b/src/main/jbake/content/documentation/bundles/scripting/scripting-htl.md
index c7d7f95..5574432 100644
--- a/src/main/jbake/content/documentation/bundles/scripting/scripting-htl.md
+++ b/src/main/jbake/content/documentation/bundles/scripting/scripting-htl.md
@@ -20,7 +20,7 @@ The Sling implementation is comprised of the following modules:
 6. [`org.apache.sling.scripting.sightly.repl`](https://github.com/apache/sling-org-apache-sling-scripting-sightly-repl) - HTL Read-Eval-Print Loop Environment (REPL), useful for quickly prototyping scripts
 7. [`htl-maven-plugin`](https://github.com/apache/sling-htl-maven-plugin) - M2Eclipse compatible HTL Maven Plugin that provides support for validating HTML Template Language scripts from projects during build time
 
-## The Use-API
+# The Use-API
 
 The [HTML Template Language Specification](https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#4-use-api) explicitly defines two ways of implementing support for business logic objects:
 
@@ -65,7 +65,7 @@ The Sling HTL Scripting engine fully complies with the [HTML Template Language S
 ### Format Date
 
 In addition to the regular patterns defined in [HTL Spec 1.2.2.2](https://github.com/adobe/htl-spec/blob/1.4/SPECIFICATION.md#1222-dates) the following special formatting patterns are supported ([SLING-9983](https://issues.apache.org/jira/browse/SLING-9983)) for formatting dates only (disregarding time) in a decent format for the used locale.
-*The result depends on the JDK version though, as it changed fundamentally with [JDK 8](https://openjdk.java.net/jeps/252), and even afterwards the [CLDR releases](http://cldr.unicode.org/index/downloads) implemented in the different JDK versions differ quite substantially.*
+*The resulting format depends on the JDK version though, as it changed fundamentally with [JDK 8](https://openjdk.java.net/jeps/252), and even afterwards the different [CLDR releases](http://cldr.unicode.org/index/downloads) implemented in the different JDK versions differ quite substantially.*
 
 
 Pattern | Description | Example (for Locale en_US)
@@ -74,7 +74,11 @@ Pattern | Description | Example (for Locale en_US)
 `medium` | A medium representation of the date (disregarding time), with some detail | Oct 26, 1985 
 `long` | A long representation of the date (disregarding time), with lots of detail | October 26, 1985
 `full` | The full represenation of the date (disregarding time), with the most detail | Saturday, October 26, 1985
-`default` | Is equal to `medium` | Oct 26, 1985 
+`default` | Is equal to `medium` | Oct 26, 1985
+
+Those pattern values are case-insensitive.
+
+The implementation uses [`DateTimeFormatter.ofLocalizedDate(FormatStyle)`](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html#ofLocalizedDate-java.time.format.FormatStyle-) for formatting those dates.
 
 
 ## Use-API Extensions