You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Esterbi Thanks for the report. Could you add the actual code you're running (e.g. what are the ...s – are they e.g. local times in some timezone?), or in any case a reproducible example, to make this easier to triage?
Well, for example format_date(self.date, locale='ru', format=' EE YYYY'). But I've tried locale 'en', and got same result as well (that's why I've not mentioned that).
Another example (for django admin):
def open_tren_last(obj):
if obj.open_tren.exists():
last = obj.open_tren.latest('date')
format = 'dd MMM YYYY'
date_info = format_datetime(last.date, locale='ru', format=format,
tzinfo=datetime.timezone(
datetime.timedelta(
hours=3))).capitalize()
I've tried also different tzinfo, but have got same result.
I'm using Django 3.2.25 in my project, so all dates come from models, like (for example above) date = models.DateField(verbose_name='Дата тренировки', )
Maybe problem is in some outdated libs in my project, which babel is using? I mean, you don't have same result? I've included all libs from my venv, may be it could help. (Yeah, I know they are outdated, but it's first time I have problems with such common library as babel). Also it's strange for me that function returns so different results depends on year. May be it's my mistake somehow, but I still wonder why it is so. I've checked all my code, using different combinations of locale and tzinfo, but got same result. Problem is only with year, days and months are still fully valid with any locale or tzinfo. req.txt
Overview Description
I've noticed that format_date(..., ..., format='YYYY'):
Version Information
I'm using babel 2.9.0, but upgrade to 2.16.0 doesn't solve issue.
Additional Information
It's my first issue ever, so I'm sorry in advance for any mistakes in the formalization.
The text was updated successfully, but these errors were encountered: