Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time picker portion always uses 24-hour format #7

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

Time picker portion always uses 24-hour format #7

jochenberger opened this issue Aug 20, 2010 · 2 comments

Comments

@jochenberger
Copy link
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
@jochenberger
Copy link
Collaborator Author

I'm beginning to get the hang of it. ;-): http://github.com/jochenberger/tapx/commit/9fca265aa3dcf235a488a92c7e63faa2faca0c38

@hlship
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants