Skip to content

Remove all format_* wrappers #164

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

Closed
9 tasks done
TkTech opened this issue Feb 25, 2020 · 1 comment
Closed
9 tasks done

Remove all format_* wrappers #164

TkTech opened this issue Feb 25, 2020 · 1 comment
Assignees
Milestone

Comments

@TkTech
Copy link
Contributor

TkTech commented Feb 25, 2020

Our API is never up to date with babel (ex: #142), and we do not cover the entire babel API. Our wrappers add no real value, and add a lot of surface area for test coverage. Just like flask-wtforms did way back in version 0.9, we should focus on just being the glue between flask and babel.

  • format_datetime
  • format_date
  • format_time
  • format_timedelta
  • format_number
  • format_decimal
  • format_currency
  • format_percent
  • format_scientific

As part of this, we need to improve the documentation to show better examples of using get_locale and get_timezone.

@homeworkprod
Copy link
Contributor

Hi @TkTech,

while I do agree with this move, I'd like to point out that while Flask-Babel's format_date rebases according to the time zone, Babel's format_date does not. This might be a bad surprise for users after upgrading to v3.0.

I have raised an issue against Babel, hoping that Babel will gain this ability. But I guess it could use some more backing.

@TkTech TkTech closed this as completed Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants