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

apps/budgeting/proposal-item: using internationalized date #3986

Merged
merged 2 commits into from
Nov 29, 2021

Conversation

khamui
Copy link
Contributor

@khamui khamui commented Nov 25, 2021

No description provided.

@khamui
Copy link
Contributor Author

khamui commented Nov 25, 2021

i found this build-in way to make dates internationalized (similar to what we have in Django). So i wrapped it into a helper function. and we don't need a third party library for it.

In order to have this working, we need to pass locale information to the frontend. What do you guys think?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl

PS:
I have to admit the template filters (richtext, intcomma, date etc.) is a cool concept in Django. Don't know why react does not offer these converters.

@github-actions
Copy link

Coverage report

Total coverage

Status Category Percentage Covered / Total
🔴 Statements 3.14% 39/1242
🔴 Branches 2.93% 21/716
🔴 Functions 4.15% 17/410
🔴 Lines 6.79% 248/3654

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Show files with reduced coverage 🔻

Reduced coverage

Status Filename Statements Branches Functions Lines
🟢 meinberlin/apps/budgeting/assets/BudgetingProposalListItem.jsx 100% 83.33% (-16.67% 🔻) 100% 100%

Status of coverage: 🟢 - ok, 🟡 - slightly more than threshold, 🔴 - under the threshold

Report generated by 🧪jest coverage report action from 164b597

Copy link
Contributor

@fuzzylogic2000 fuzzylogic2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
It will not have a huge impact in mB, where we force the locale to be German (https://github.com/liqd/admin/blob/a9c81b672cf1863c5f6e256402f96ea734cf8ec2/pillar/servers/berlin-adhocracy4-prod.sls#L119), but it might solve our problems elsewhere!

@fuzzylogic2000 fuzzylogic2000 merged commit 522051a into main Nov 29, 2021
@fuzzylogic2000 fuzzylogic2000 deleted the kt-2021-11-date-formatting branch November 29, 2021 07:35
Copy link
Contributor

@sabinammm sabinammm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really nice & working perfectly for me:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants