summaryrefslogtreecommitdiff
path: root/addons/website_event/controllers/main.py
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2015-06-01 14:47:37 +0200
committerGoffin Simon <sig@odoo.com>2015-06-02 10:42:46 +0200
commiteabf7df5f9793d11b22fa5e9a43caf52822ea649 (patch)
treee3a2ddb3dc5866455cb56173ca218deef6c44ad5 /addons/website_event/controllers/main.py
parenta9e3d74713b6882c64617345696ad326d75a4745 (diff)
[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
Diffstat (limited to 'addons/website_event/controllers/main.py')
-rw-r--r--addons/website_event/controllers/main.py8
1 files 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,[]