-
Notifications
You must be signed in to change notification settings - Fork 4
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: add getSiblingFixedPeriods #15
Conversation
4f2055b
to
39bf7b2
Compare
3253bd1
to
9f7beca
Compare
39bf7b2
to
795e64f
Compare
b6bdbea
to
3e89eff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two general comments about approach / code:
-
code-wise, similar to previous PR, I think you can get rid of date comparisons and compare the date strings
-
regarding the approach, these two set of methods (previous vs following) seem so similar, almost identical in the case of yearly and daily, that it just feels like it's a lot of repetition there. There might be a case for separating them into two sets if they were conceptually different, but they also seem very similar conceptually for me - so any changes in logic for "previous" are likely to apply "following". Am I right in thinking they're conceptually very similar?
I don't think we always need to follow DRY for the sake of it but here specifically, it feels like we should.
-
Can you also clarify for me where these are used in the data-entry app (or point me to have a look) .. I think maybe that helps me understand some of the decisions here.
-
Regarding all the edge cases around start and end of years, would it have been possible to just populate the previous and subsequent year, along the current year ... and just lookup those when there is no match .. that feels cheaper (which is not very important) but simpler (which is important) than the workarounds we have now.
11dfbf2
to
7128937
Compare
7128937
to
a891c9f
Compare
✔️ Using string comparison now
✔️ Merged into one function called
Can you point me to what you're referring to? |
98a4059
to
72be9e1
Compare
72be9e1
to
23cd625
Compare
# [1.0.0-alpha.21](v1.0.0-alpha.20...v1.0.0-alpha.21) (2023-03-02) ### Features * add getSiblingFixedPeriods ([#15](#15)) ([59cb406](59cb406))
🎉 This PR is included in version 1.0.0-alpha.21 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# [1.1.0](v1.0.2...v1.1.0) (2024-01-10) ### Bug Fixes * **generate daily fixed periods:** use correct comparison for "endsBefore" ([#21](#21)) ([3cdb2be](3cdb2be)) ### Features * add createFixedPeriodFromPeriodId method ([#13](#13)) ([ef1132e](ef1132e)) * add getFixedPeriodByDate ([#14](#14)) ([9de82e0](9de82e0)) * add getSiblingFixedPeriods ([#15](#15)) ([59cb406](59cb406)) * **generate fixed periods:** add "endsBefore" option ([#20](#20)) ([6667c97](6667c97))
🎉 This PR is included in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Blocked by #13