https://github.com/craiglittle/clavius
Date calculations based on a schedule.
https://github.com/craiglittle/clavius
computation ruby time
Last synced: about 1 year ago
JSON representation
Date calculations based on a schedule.
- Host: GitHub
- URL: https://github.com/craiglittle/clavius
- Owner: craiglittle
- License: mit
- Created: 2015-03-01T02:20:33.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-09-19T22:37:18.000Z (almost 3 years ago)
- Last Synced: 2024-04-24T05:03:07.130Z (about 2 years ago)
- Topics: computation, ruby, time
- Language: Ruby
- Size: 69.3 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clavius
[](http://badge.fury.io/rb/clavius)
[](https://github.com/craiglittle/clavius/actions?query=branch%3Amaster)
[](https://codeclimate.com/github/craiglittle/clavius)
[](https://codeclimate.com/github/craiglittle/clavius)
Date calculations based on a schedule.
## Installation
```
gem install clavius
```
## Configuration
```ruby
Clavius.configure do |c|
c.weekdays = %i[mon tue wed thu fri]
c.included = [Date.new(2023, 7, 1)]
c.excluded = [Date.new(2023, 7, 4), Date.new(2023, 12, 25)]
end
```
## Usage
```ruby
Clavius.active?(Date.new(2023, 1, 5))
Clavius.days(5).before(Date.new(2023, 1, 5))
Clavius.days(2).after(Date.new(2023, 1, 5))
Clavius.between(Date.new(2023, 1, 1), Date.new(2023, 1, 8))
```
## Contributing
Pull requests are welcome, but consider asking for a feature or bug fix first
through the issue tracker. When contributing code, please squash sloppy commits
aggressively and follow [Tim Pope's guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
for commit messages.
## Copyright
Copyright (c) 2015-2023 Craig Little. See [LICENSE][license] for details.
[license]: https://github.com/craiglittle/clavius/blob/master/LICENSE