Time picker portion always uses 24-hour format #7

Closed
jochenberger opened this Issue Aug 20, 2010 · 2 comments

Projects

None yet

2 participants

@jochenberger
Collaborator

The hour selector in the popup always uses the default timeFormat of "24". I created a patch that chooses "12" or "24" depending on whether the format pattern contains a "%p". Unfortunately I'm new to git(hub) and I'm not sure how to go on now, but as the change is a one-liner I'll just write it down here:

From c575952f11c34940a5b382e46863189a69a061b1 Mon Sep 17 00:00:00 2001
From: Jochen Berger <fooberger@googlemail.com>
Date: Fri, 20 Aug 2010 13:26:57 +0200
Subject: [PATCH 1/2] use 12- or 24-hour time format depending on format pattern

---
 .../tapx/datefield/tapx-datefield.js               |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tapx-datefield/src/main/resources/com/howardlewisship/tapx/datefield/tapx-datefield.js b/tapx-datefield/src/main/resources/com/howardlewisship/tapx/datefield/tapx-datefield.js
index c81de65..168f610 100644
--- a/tapx-datefield/src/main/resources/com/howardlewisship/tapx/datefield/tapx-datefield.js
+++ b/tapx-datefield/src/main/resources/com/howardlewisship/tapx/datefield/tapx-datefield.js
@@ -6,6 +6,7 @@ Tapestry.Initializer.tapxDateField = function(spec)
         weekNumbers : false,
         showsTime : spec.time,
         ifFormat : spec.clientDateFormat,
+        timeFormat : spec.time && spec.clientDateFormat.match("%p") != null ? "12" : "24",
         cache : true
     });
 }
\ No newline at end of file
-- 
1.7.0.4
Owner
hlship commented Dec 3, 2010

Fixed by 7b77e28

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment