[Zope3-checkins] CVS: Zope3/src/zope/i18n - format.py:1.11 locales.py:1.15
Stephan Richter
srichter@cosmos.phy.tufts.edu
Sat, 26 Jul 2003 09:11:49 -0400
Update of /cvs-repository/Zope3/src/zope/i18n
In directory cvs.zope.org:/tmp/cvs-serv9459/src/zope/i18n
Modified Files:
format.py locales.py
Log Message:
Fixed two bugs in the I18n formatter.
Urgent To Do's:
- Support of Timezones in zope.i18n.format
- Removal of the datetimeutils code; it is not I18n aware...
=== Zope3/src/zope/i18n/format.py 1.10 => 1.11 ===
--- Zope3/src/zope/i18n/format.py:1.10 Mon Jun 30 12:29:15 2003
+++ Zope3/src/zope/i18n/format.py Sat Jul 26 09:11:14 2003
@@ -99,7 +99,7 @@
if id in bin_pattern:
ampm = self.calendar.pm == results[
bin_pattern.index(('a', 1))]
- ordered[3] = int(results[bin_pattern.index(id)]) + 12*ampm
+ ordered[3] = (int(results[bin_pattern.index(id)]) + 12*ampm)%24
# Shortcut for the simple int functions
dt_fields_map = {'M': 1, 'd': 2, 'H': 3, 'm': 4, 's': 5, 'S': 6}
for field in dt_fields_map.keys():
@@ -515,7 +515,7 @@
('D', 1): dt.strftime('%j'),
('w', 1): dt.strftime('%W'),
('w', 2): dt.strftime('%.2W'),
- ('h', 1): str(dt.hour%12+1),
+ ('h', 1): str(dt.hour%12),
('h', 2): "%.2i" %(dt.hour%12),
('H', 1): str(dt.hour),
('H', 2): "%.2i" %dt.hour,
=== Zope3/src/zope/i18n/locales.py 1.14 => 1.15 ===
--- Zope3/src/zope/i18n/locales.py:1.14 Fri Jun 6 15:29:09 2003
+++ Zope3/src/zope/i18n/locales.py Sat Jul 26 09:11:14 2003
@@ -192,7 +192,7 @@
self.klass = klass
self.months = {}
self.weekdays = {}
- self.eras = {}
+ self.eras = {0: '', 1: ''}
self.am = u''
self.pm = u''
self.patternCharacters = u''