[FIX] website_blog: babel yyyy vs YYYY
In the format_date function of babel.dates, there is a difference between `yyyy` and `YYYY`. `YYYY` should only be used in combination with the week number. See issue https://github.com/python-babel/babel/issues/419 closes odoo/odoo#42735 Related: odoo/enterprise#7536 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -50,7 +50,7 @@ class WebsiteBlog(http.Controller):
|
||||
tzinfo = pytz.timezone(request.context.get('tz', 'utc') or 'utc')
|
||||
|
||||
group['month'] = babel.dates.format_datetime(start, format='MMMM', tzinfo=tzinfo, locale=locale)
|
||||
group['year'] = babel.dates.format_datetime(start, format='YYYY', tzinfo=tzinfo, locale=locale)
|
||||
group['year'] = babel.dates.format_datetime(start, format='yyyy', tzinfo=tzinfo, locale=locale)
|
||||
|
||||
return OrderedDict((year, [m for m in months]) for year, months in itertools.groupby(groups, lambda g: g['year']))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user