You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2013/12/05 01:55:59 UTC

[2/4] TAP5-2251: Add LocalDate component to present formatted date/time in client's time zone

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2bc3c14c/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties b/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
index 93c3f69..083baa0 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
@@ -124,4 +124,7 @@ core-components.submit.class=btn btn-primary
 core-alerts-show-dismiss-all=true
 
 default-confirm-message=Are you sure you want to continue?
-default-confirm-title=Confirm
\ No newline at end of file
+default-confirm-title=Confirm
+
+# See the LocalDate component
+private-default-localdate-format=lll
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2bc3c14c/tapestry-core/src/test/app1/LocalDateDemo.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/app1/LocalDateDemo.tml b/tapestry-core/src/test/app1/LocalDateDemo.tml
new file mode 100644
index 0000000..26d7eca
--- /dev/null
+++ b/tapestry-core/src/test/app1/LocalDateDemo.tml
@@ -0,0 +1,17 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+
+    <h1>Local Date Demo</h1>
+
+    <p>The current time is:</p>
+
+    <div class="alert alert-info" t:type="localdate" id="local-date-default" value="now"/>
+
+    <p>
+        It is also
+        <t:localdate id="local-date-formatted" value="now" format="dddd, MMMM Do YYYY, h:mm:ss a">
+            Body of element is ignored.
+        </t:localdate>
+    </p>
+
+</html>
+

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2bc3c14c/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/pages/LocalDateDemo.groovy
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/pages/LocalDateDemo.groovy b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/pages/LocalDateDemo.groovy
new file mode 100644
index 0000000..175f098
--- /dev/null
+++ b/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/pages/LocalDateDemo.groovy
@@ -0,0 +1,8 @@
+package org.apache.tapestry5.integration.app1.pages
+
+class LocalDateDemo {
+
+    Date getNow() {
+        new Date()
+    }
+}

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2bc3c14c/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
index c74afd9..c0ad97c 100644
--- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
+++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
@@ -58,6 +58,7 @@ public class Index
 
     private static final List<Item> ITEMS = CollectionFactory
             .newList(
+                    new Item("LocalDateDemo", "Local Date Demo", "LocalDate component, based on moment.js"),
 
                     new Item("EmptyIfDemo", "Empty If Demo", "Ensure an empty If can still render."),