Skip to content

♻️ refactor: make header labels more accurate#188

Merged
tyler-dane merged 3 commits into
SwitchbackTech:mainfrom
murilo9:refactor/issue#165
Dec 14, 2024
Merged

♻️ refactor: make header labels more accurate#188
tyler-dane merged 3 commits into
SwitchbackTech:mainfrom
murilo9:refactor/issue#165

Conversation

@murilo9
Copy link
Copy Markdown
Contributor

@murilo9 murilo9 commented Dec 14, 2024

This resolves issue #165

What I've done:

  • Created a getCalendarHeadingLabel util function for Header.tsx.
  • Refactored getWeekRangeLabel util function so it can return two different formats.
  • Added a web.date.util.test.ts file, containing unit tests for getWeekRangeLabel and getCalendarHeadingLabel.
  • Left getMonthListLabel unmodified, as it already behaves as expected (returns the full month name of week start).

I didn't write unit tests for getMonthListLabel due to its simplicity, but I can add it if you see it as necessary.
All unit tests (including the added ones) have passed.

@murilo9
Copy link
Copy Markdown
Contributor Author

murilo9 commented Dec 14, 2024

Some observations: in my opinion, the format of Someday Week label could be improved, as "M.D - D" is not very intuitive. Maybe the "MMM D - D" format could be better? That way it would be more intuitive and not repeat the full month name ("MMMM") like in the Someday Month label.

@tyler-dane tyler-dane linked an issue Dec 14, 2024 that may be closed by this pull request
2 tasks
@tyler-dane tyler-dane self-requested a review December 14, 2024 12:00
murilo9 and others added 3 commits December 14, 2024 06:37
these comments don't add additional value to the code
in addition, they hard-code the concept of a 'week' into the
implementation, making this harder to support other views (4 day, 1 day,
etc)
remove concept of weekStart/weekEnd in place of start/end
@tyler-dane
Copy link
Copy Markdown
Contributor

Some observations: in my opinion, the format of Someday Week label could be improved, as "M.D - D" is not very intuitive. Maybe the "MMM D - D" format could be better? That way it would be more intuitive and not repeat the full month name ("MMMM") like in the Someday Month label.

Thank you for the suggestion! I'll keep this in mind and compare it to other user feedback on this change

@tyler-dane tyler-dane merged commit 660df77 into SwitchbackTech:main Dec 14, 2024
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.

Make header labels more accurate

2 participants