From 7def5b9e4390945d5f2cc8667b69a056fb554b84 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Thu, 5 Dec 2013 14:27:28 +0100 Subject: [PATCH 1/2] reduce default width of form fields for better fit on standard pages --- composer/schema/browser/schema_macros.pt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer/schema/browser/schema_macros.pt b/composer/schema/browser/schema_macros.pt index b66dfaa..da3a145 100755 --- a/composer/schema/browser/schema_macros.pt +++ b/composer/schema/browser/schema_macros.pt @@ -90,7 +90,7 @@ tal:define="width field/width|nothing" tal:attributes="name name; id name; style python: - ('width: %s;;' % (width and str(width)+'px' or '600px')) + + ('width: %s;;' % (width and str(width)+'px' or '570px')) + 'height: 1.5em;;'; value data/?name|string:; xxrequired field/required_js;" /> From f29132406a3ad460a451bd39fc2c9ab6ee9746e4 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 11 Dec 2013 09:43:02 +0100 Subject: [PATCH 2/2] unify date strings/remove excess parts before parsing --- util/date.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/date.py b/util/date.py index 2900865..fd495b0 100644 --- a/util/date.py +++ b/util/date.py @@ -51,13 +51,14 @@ def formatTimeStamp(ts, useGM=False, format='%Y-%m-%d %H:%M'): def str2timeStamp(s): + s = s.replace('T', ' ') try: - t = time.strptime(s, '%Y-%m-%d %H:%M:%S') + t = time.strptime(s[:19], '%Y-%m-%d %H:%M:%S') except ValueError: try: - t = time.strptime(s, '%Y-%m-%d %H:%M') + t = time.strptime(s[:16], '%Y-%m-%d %H:%M') except ValueError: - t = time.strptime(s, '%Y-%m-%d') + t = time.strptime(s[:10], '%Y-%m-%d') return int(time.mktime(t))