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

Add option to specify start of the week #240

Merged
merged 7 commits into from
Jan 4, 2019

Conversation

pedrorivotti
Copy link
Contributor

This PR adds a configurable option, options.week_start, that allows specifying the start day of a week for reporting and logging purposes.

This is useful for those who (like me) need to report weekly time based on a starting day other than Monday. Sunday would be the other common starting day, but I've added the option to specify any day of the week, for completeness.

I've included tests, and a short entry in the docs.

Open to suggestions, of course!

@jmaupetit
Copy link
Contributor

Hi @pedrorivotti ! Thanks for this useful feature 🙏 We'll review it quickly.

@jmaupetit jmaupetit requested a review from k4nar December 10, 2018 10:00
watson/cli.py Outdated
# Add an offset to match the week beginning specified in the
# configuration
if param.name == "week":
week_start = ctx.obj.config.get("options", "week_start")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we set a default as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @k4nar , well spotted!

@pedrorivotti pedrorivotti reopened this Jan 4, 2019
@k4nar k4nar merged commit 5cdf1c4 into jazzband:master Jan 4, 2019
@k4nar
Copy link
Collaborator

k4nar commented Jan 4, 2019

Thanks!

jmaupetit added a commit that referenced this pull request Mar 25, 2019
Added:

- New `add` command (#202)
- Add lunar start time options to the `report` and `log` commands (#215)
- Aggregate reports by day (#231)
- Fish shell completion (#239)
- Add support for first day of the week configuration in reports and logs (#240)
- Python 3.7 support (#241)
- Add `start --no-gap` and `stop --at` options (#254)

Changed:

- The `edit` command now checks data consistency (#203)
- Current state saving is now improve when using Watson as a library (#214)
- Prevent calling `get_start_time_for_period` multiple times (#219)

Fixed:

- Improved support for UTF-8 with Python 2 (#211)
- Zsh completion for tags and projects with spaces in their names (#227)
- Typos in commands output (#230, #235)
- Project URL of the project in PyPI (#260)

Removed:

- Python 3.3 support (#210).
@jmaupetit jmaupetit mentioned this pull request Mar 25, 2019
jmaupetit added a commit that referenced this pull request Mar 25, 2019
Added:

- New `add` command (#202)
- Add lunar start time options to the `report` and `log` commands (#215)
- Aggregate reports by day (#231)
- Fish shell completion (#239)
- Add support for first day of the week configuration in reports and logs (#240)
- Python 3.7 support (#241)
- Add `start --no-gap` and `stop --at` options (#254)

Changed:

- The `edit` command now checks data consistency (#203)
- Current state saving is now improve when using Watson as a library (#214)
- Prevent calling `get_start_time_for_period` multiple times (#219)

Fixed:

- Improved support for UTF-8 with Python 2 (#211)
- Zsh completion for tags and projects with spaces in their names (#227)
- Typos in commands output (#230, #235)
- Project URL of the project in PyPI (#260)

Removed:

- Python 3.3 support (#210).
jmaupetit added a commit that referenced this pull request Mar 25, 2019
Added:

- New `add` command (#202)
- Add lunar start time options to the `report` and `log` commands (#215)
- Aggregate reports by day (#231)
- Fish shell completion (#239)
- Add support for first day of the week configuration in reports and logs (#240)
- Python 3.7 support (#241)
- Add `start --no-gap` and `stop --at` options (#254)

Changed:

- The `edit` command now checks data consistency (#203)
- Current state saving is now improve when using Watson as a library (#214)
- Prevent calling `get_start_time_for_period` multiple times (#219)

Fixed:

- Improved support for UTF-8 with Python 2 (#211)
- Zsh completion for tags and projects with spaces in their names (#227)
- Typos in commands output (#230, #235)
- Project URL of the project in PyPI (#260)

Removed:

- Python 3.3 support (#210).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants