-
Notifications
You must be signed in to change notification settings - Fork 298
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 fortnightly interval #1955
base: main
Are you sure you want to change the base?
Conversation
6fba497
to
4a34f47
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.
Thanks for the PR, looks good - I just left some minor comments.
@@ -93,6 +96,31 @@ class Interval(Enum): | |||
YEAR = "year" | |||
QUARTER = "quarter" | |||
MONTH = "month" | |||
FORTNIGHT = "fortnight" | |||
# Note: While a fortnight is a well-defined time interval, there are no |
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.
Can you move this (maybe in a slightly shortened form) to the help pages this seems relevant for users to understand how this works
src/fava/util/date.py
Outdated
# If we are in the first fortnight of the year, finding the last | ||
# fortnight of the previous year is a bit tricky due to being either | ||
# starting on week 51 or 53 (if the year has 53 weeks). | ||
try: |
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.
This file had complete code coverage in tests (except for the annotated lines), with your changes some cases don't seem to be fully covered - e.g. this try-except-block. Can you add some more tests for those? (make test
will show the lines or you can take a look at the HTML coverage in htmlcov
)
frontend/src/lib/interval.ts
Outdated
@@ -1,28 +1,36 @@ | |||
import { _ } from "../i18n"; | |||
|
|||
export type Interval = "year" | "quarter" | "month" | "week" | "day"; | |||
export type Interval = | |||
| "year" |
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.
seems these lines are indented with tabs and not spaces - I noticed ts
was missing from the pre-commit config for prettier, I just fixed that on main - can you rebase and re-run pre-commit to switch to spaces here as well?
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 noticed the formatting changes and just assumed it was covered pre-commit (maybe incrementally changes the style or something)
More than happy to rebase 👍
In some countries (such as Australia), it is very common for wages to be paid on a fortnightly basis, that is, every 2 weeks. As a result, a number of other expenses are also paid on a fortnightly basis. This commit extends the `Interval` enum by adding a `FORTNIGHT` option. I have added a test for that, and have updated the translations where possible (not that other than for English and French, the other translations may be suboptimal). Resolves: beancount#1939 Signed-off-by: JP-Ellis <[email protected]>
Made a few improvements to the budgets docs by: - Specifying how budgets can replace previous one using an example - Expanding a bit on how each interval is calculated - Some minor refactors to help everything flow a bit better Signed-off-by: JP-Ellis <[email protected]>
4a34f47
to
84fcdbb
Compare
I also realised I misunderstood the 'get_prev_interval' which returns that start of the current interval. So good to have improved test coverage. Signed-off-by: JP-Ellis <[email protected]>
I have updated the tests to ensure 100% test coverage. I did have to add to lines with For the coverage, would you be open to a PR adding integration with Codecov? This will help see coverage of PRs automatically, and it is free for OSS projects. You can see an example of how Codecov integrates within GitHub at: pact-foundation/pact-python#935 And you can follow links therein to see the more detailed coverage reports. |
In some countries (such as Australia), it is very common for wages to be paid on a fortnightly basis, that is, every 2 weeks. As a result, a number of other expenses are also paid on a fortnightly basis.
This commit extends the
Interval
enum by adding aFORTNIGHT
option. I have added a test for that, and have updated the translations where possible (not that other than for English and French, the other translations may be suboptimal).As part of this commit, I have also taken the opportunity to fix a confusion between ISO weeks and calendar weeks as the two do not always match, andEDIT: I have moved this into #1956.2025-W01
is the ISO format indicating the week starting on December 30 2024. Let me know if you want me to split out this particular change into a separate PR.Resolves: #1939