feat: shorten weekly period display labels#93
Draft
eirikhaugstulen wants to merge 4 commits into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
==========================================
- Coverage 90.87% 90.84% -0.03%
==========================================
Files 57 57
Lines 1249 1245 -4
Branches 352 352
==========================================
- Hits 1135 1131 -4
Misses 112 112
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Shortens weekly fixed-period
nameanddisplayNamevalues to contain only the week title, e.g.Week 1, while preservingstartDateandendDateas structured fields.Why
Weekly labels currently include the date range, e.g.
Week 1 - 2025-12-29 - 2026-01-04. Consumers that need a shorter UI label have to parse this localized display string, which is fragile. Since the period object already exposesstartDateandendDate, callers can compose richer labels themselves.This also makes weekly period display names more consistent with monthly periods, where the display name is the period title and dates remain separate structured fields.
Testing
CI=true yarn test --runInBand --watchAll=false --watchman=false src/period-calculation/generate-fixed-periods src/period-calculation/create-fixed-period-from-period-id src/period-calculation/get-adjacent-fixed-periodsyarn cucumberyarn lintyarn build:typesgit diff --check