NMF-earth / nmf-app

Understand and reduce your carbon footprint 🌱 iOS & Android.
https://nmf.earth
GNU General Public License v3.0
508 stars 157 forks source link

Resolved incorrect locale casing for period on 'Carbon Budget' view #345

Closed ijdershem closed 3 years ago

ijdershem commented 3 years ago

✅ I have read the contributing file

Summary

This aims to display the correct period information in the Carbon Budget view by removing a function call that makes the period lowercase on the PeriodBudget component. As shown below, the locale casing for the period on the ProgressChart component is incorrect.

The lack of capitalization of the month of "November" caught my attention as I was familiarizing myself with the platform. I figured this was a great starting point for my first contribution to the nmf-app project!

Changelog

Removed a call to toLowerCase() on when passing the period prop to the PeriodBudget component within the ProgressChart view.

Demo

Progress Chart Before

Period Budget Before

Progress Chart After

Period Budget After
PierreBresson commented 3 years ago

@ijdershem thanks, that's country specific (in french there isn't any cap to dates) but since app is mostly used in english, let's go for it 👍

ijdershem commented 3 years ago

@ijdershem thanks, that's country specific (in french there isn't any cap to dates) but since app is mostly used in english, let's go for it 👍

@PierreBresson I was concerned about that but it seems moment.js has well checked and defined locale definitions that take this kind of thing into account e.g.

Period Budget Locale Moment js Example

per this discussion: https://stackoverflow.com/questions/35913934/uppercasing-monthnames-in-momentjs, I believe speakers of each language have maintained the correct casing per locale