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

feat(tupaiaWeb): RN-1304: Date offsets for year granularities #5695

Merged
merged 41 commits into from
Sep 26, 2024

Conversation

alexd-bes
Copy link
Contributor

@alexd-bes alexd-bes commented Jun 3, 2024

Issue RN-1304: Date offsets for year granularities

Changes:

  • Enabled dateOffset config in dashboard items to allow for offsets to be set for period granularities. Currently only works as expected with year/single year granularities. Assume that there will be unintended results with any other granularity for now.
  • Enabled dateRangeDelimiter config for dashboard items, which allows a custom delimiter to be set for offset ranges, for single years, e.g. June 2019/May 2020 etc. Only applies to single date ranges

Screenshots:

Screenshot 2024-06-04 at 10 23 27 AM

Screenshot 2024-06-04 at 10 23 42 AM

.startOf(value.momentUnit)
.format(value.rangeFormat);
const prevEndDate = momentToDateDisplayString(
moment(END_DATE).add(-1, value.momentShorthand).endOf(value.momentUnit),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
moment(END_DATE).add(-1, value.momentShorthand).endOf(value.momentUnit),
moment(END_DATE).subtract(1, value.momentShorthand).endOf(value.momentUnit),

Copy link
Contributor

@jaskfla jaskfla left a comment

Choose a reason for hiding this comment

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

Sorry about the delay! I had gotten partway through this and then closed the tab at some point 😅

The complexity here is a bit beyond what I can grasp just by looking at the code, but got nothin’ to complain about in any given part. Do tag Rohan if there’s something you wanted a more rigorous review on

@alexd-bes alexd-bes merged commit 3c72db9 into dev Sep 26, 2024
44 checks passed
@alexd-bes alexd-bes deleted the rn-1304-single-year-offset branch September 26, 2024 04:25
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