From: Alex Morega Date: Thu, 4 Jul 2013 22:11:28 +0000 (+0200) Subject: handle 'at' value from en date format X-Git-Tag: 1.0~129^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35bb0db6822021fba939f5cdb446a776148432b5;p=thirdparty%2Fbabel.git handle 'at' value from en date format --- diff --git a/babel/core.py b/babel/core.py index 4d5a6367..31cfec0b 100644 --- a/babel/core.py +++ b/babel/core.py @@ -585,7 +585,7 @@ class Locale(object): """Locale patterns for datetime formatting. >>> Locale('en').datetime_formats['full'] - u'{1} {0}' + u"{1} 'at' {0}" >>> Locale('th').datetime_formats['medium'] u'{1}, {0}' diff --git a/babel/dates.py b/babel/dates.py index 430da463..a1f46de3 100644 --- a/babel/dates.py +++ b/babel/dates.py @@ -490,6 +490,7 @@ def format_datetime(datetime=None, format='medium', tzinfo=None, locale = Locale.parse(locale) if format in ('full', 'long', 'medium', 'short'): return get_datetime_format(format, locale=locale) \ + .replace("'", "") \ .replace('{0}', format_time(datetime, format, tzinfo=None, locale=locale)) \ .replace('{1}', format_date(datetime, format, locale=locale)) diff --git a/babel/tests/dates.py b/babel/tests/dates.py index 2e682d1a..8ebecb77 100644 --- a/babel/tests/dates.py +++ b/babel/tests/dates.py @@ -255,8 +255,7 @@ class FormatDatetimeTestCase(unittest.TestCase): d = datetime(2012, 4, 1, 15, 30, 29, tzinfo=timezone('UTC')) epoch = float(calendar.timegm(d.timetuple())) formatted_string = dates.format_datetime(epoch, format='long', locale='en_US') - self.assertEqual(u'April 1, 2012 3:30:29 PM +0000', formatted_string) - + self.assertEqual(u'April 1, 2012 at 3:30:29 PM +0000', formatted_string) class FormatTimeTestCase(unittest.TestCase):