Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ошибка с порядковыми числительными #13

Closed
AlexxIT opened this issue Nov 8, 2021 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 8, 2021

Подскажите, можно текущую дату склонять? хочу получить ВОСЬМОГО ноября

{{ now().timestamp()|timestamp_custom('%d') }} ==> 08

{{ now().timestamp()|timestamp_custom('%d')|format(morph='первого') }} ==> восемь первых

{{ now().timestamp()|timestamp_custom('%d')|format(morph='первого', as_ordinal=True) }} ==> TypeError: '>=' not supported between instances of 'str' and 'int'

@AlexxIT AlexxIT added the bug Something isn't working label Nov 8, 2021
@kknishev
Copy link

kknishev commented Nov 8, 2021

Проблема в том, что timestamp_custom по умолчанию во float, если явно задать int, то работает
{{ now().timestamp()|timestamp_custom('%d')|int|format(morph='первого', as_ordinal=True) }} ==> восьмого

@AlexxIT
Copy link
Owner Author

AlexxIT commented Jun 12, 2023

@AlexxIT AlexxIT closed this as completed Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants