From eabf7df5f9793d11b22fa5e9a43caf52822ea649 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 1 Jun 2015 14:47:37 +0200 Subject: [PATCH] [FIX] website_event: format event periode The format period defined by the start_date and end_date of an event can be set according to the language. opw:640011 --- addons/website_event/controllers/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/website_event/controllers/main.py b/addons/website_event/controllers/main.py index 38b4714485e..44aaa730bad 100644 --- a/addons/website_event/controllers/main.py +++ b/addons/website_event/controllers/main.py @@ -230,8 +230,12 @@ class website_event(http.Controller): start_date = datetime.strptime(event.date_begin, tools.DEFAULT_SERVER_DATETIME_FORMAT).date() end_date = datetime.strptime(event.date_end, tools.DEFAULT_SERVER_DATETIME_FORMAT).date() month = babel.dates.get_month_names('abbreviated', locale=context.get('lang', 'en_US'))[start_date.month] - return ('%s %s%s') % (month, start_date.strftime("%e"), (end_date != start_date and ("-"+end_date.strftime("%e")) or "")) - + return _('%(month)s %(start_day)s%(end_day)s') % { + 'month': month, + 'start_day': start_date.strftime("%e"), + 'end_day': (end_date != start_date and ("-"+end_date.strftime("%e")) or "") + } + @http.route('/event/get_country_event_list', type='http', auth='public', website=True) def get_country_events(self ,**post): cr, uid, context, event_ids = request.cr, request.uid, request.context,[]