Skip to content

Commit

Permalink
fix: unclear which year it starts on
Browse files Browse the repository at this point in the history
  • Loading branch information
petterav committed Apr 23, 2024
1 parent 2719f64 commit 95a7b09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
22 changes: 11 additions & 11 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,18 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-04-02T13:38:27.904Z\n"
"PO-Revision-Date: 2024-04-02T13:38:27.904Z\n"

msgid "Growth Chart"
msgstr "Growth Chart"

msgid "There was an error fetching the config for the growth chart."
msgstr "There was an error fetching the config for the growth chart."

msgid "Please check the configuration in Datastore Management and try again."
msgstr "Please check the configuration in Datastore Management and try again."
"POT-Creation-Date: 2024-04-23T14:36:23.306Z\n"
"PO-Revision-Date: 2024-04-23T14:36:23.307Z\n"

msgid "Date"
msgstr "Date"

msgid "Age"
msgstr "Age"

msgid "Growth Chart"
msgstr "Growth Chart"

msgid "Years"
msgstr "Years"

Expand Down Expand Up @@ -91,3 +85,9 @@ msgstr "Boy"

msgid "Girl"
msgstr "Girl"

msgid "There was an error fetching the config for the growth chart."
msgstr "There was an error fetching the config for the growth chart."

msgid "Please check the configuration in Datastore Management and try again."
msgstr "Please check the configuration in Datastore Management and try again."
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ export const GrowthChartBuilder = ({
const isFirstTick = index === 0;
const isLastTick = index === values.length - 1;

if (isFirstTick) return '0';
if (isLastTick) return '12';
if (isFirstTick || isLastTick) {
const years = value / 12;
return `${years} ${years === 1 ? i18n.t('Year') : i18n.t('Years')}`;
}

const modulo = value % 12;
return modulo === 0 ? '' : modulo;
Expand Down

0 comments on commit 95a7b09

Please sign in to comment.