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

did last friday - only friday supported? #305

Closed
achingbrain opened this issue May 17, 2023 · 1 comment · Fixed by #342
Closed

did last friday - only friday supported? #305

achingbrain opened this issue May 17, 2023 · 1 comment · Fixed by #342
Labels
Milestone

Comments

@achingbrain
Copy link

The last friday command example in the README is neat but unless I'm missing something only friday seems to be supported as a argument?

% did last friday
Status report for the last friday (2023-05-12 to 2023-05-12).
... report here
% did last thursday
 ERROR  Invalid argument: 'thursday'
% did last wednesday
 ERROR  Invalid argument: 'wednesday'
% did last tuesday  
 ERROR  Invalid argument: 'tuesday'

...etc

It'd be really nice any day could be used.

@psss
Copy link
Owner

psss commented May 31, 2023

Nice idea, sounds good! And should be fairly easy to implement:

did/did/base.py

Lines 332 to 338 in 9ceed73

elif "friday" in argument:
since = Date("today")
until = Date("today")
since.date += delta(weekday=FRIDAY(-1))
until.date += delta(weekday=FRIDAY(-1))
until.date += delta(days=1)
period = "the last friday"

Pull request is welcome :)

xsuchy added a commit to xsuchy/did that referenced this issue Nov 20, 2023
xsuchy added a commit to xsuchy/did that referenced this issue Dec 5, 2023
xsuchy added a commit to xsuchy/did that referenced this issue Feb 10, 2024
@psss psss closed this as completed in cf62044 Mar 27, 2024
@psss psss added this to the 0.22 milestone Mar 27, 2024
@psss psss added the base label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants