samg / timetrap

Simple command line timetracker
http://rubygems.org/gems/timetrap
Other
1.48k stars 115 forks source link

Allow configuration to set start of week #142

Closed namdnguyen closed 7 years ago

namdnguyen commented 7 years ago

Create a week_start variable in the .timetrap.yml configuration file. Maintain the default of Monday as the start of the week when parsing timetrap week.

Update help information on timetrap week usage.

Pull request for #141.

samg commented 7 years ago

Looks good. Could you also add some test coverage to make sure this isn't inadvertently broken in the future. You can use the with_stubbed_config helper to change timetrap's config within the test context.

namdnguyen commented 7 years ago

Sure thing! I'll work I those to submit.

namdnguyen commented 7 years ago

I changed the 'week' function to be more like the 'month' one, so that it would be easier to create tests for it. Added a couple of tests for the week_start configuration, too. Let me know if it needs anything else!

samg commented 7 years ago

Sorry for the delay reviewing this. Looks like good functionality to me. Thanks for adding tests. I'll push out gem version asap.

samg commented 7 years ago

https://rubygems.org/gems/timetrap/versions/1.15.0

namdnguyen commented 7 years ago

Awesome. Thanks for reviewing and accepting the pull request!