
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
A hard-working collection of methods to make calculating working dates easier.
This gem provides a number of convenience methods to simplify calculating dates while respecting non-working days. Uses the Holiday gem so that holiday schedules can be localized and customized.
Add this line to your application's Gemfile:
gem "workdays"
And then execute:
$ bundle
Or install it yourself as:
$ gem install workdays
By default, Workdays will use :ca
as the default locale.
Date.new(2017, 2, 8) .workday? # => true
Date.new(2017, 12, 25).workday? # => false
fri_before_family_day = Date.new(2016, 2, 12) # Fri, 12 Feb 2016
family_day = Date.new(2016, 2, 15) # Mon, 15 Feb 2016
tues_after_family_day = Date.new(2016, 2, 16) # Tue, 16 Feb 2016
family_day.workday?(:ca_on) # => false
family_day.workday?(:ca_qc) # => true
tues_after_family_day.last_workday(:ca_on) # => Fri, 12 Feb 2016
tues_after_family_day.last_workday(:ca_qc) # => Mon, 15 Feb 2016
tues_after_family_day.workdays_before(1, :ca_on) # => Fri, 12 Feb 2016
tues_after_family_day.workdays_before(1, :ca_qc) # => Mon, 15 Feb 2016
tues_after_family_day.workdays_after(-1, :ca_qc) # => Mon, 15 Feb 2016
fri_before_family_day.workdays_after(1, :ca_on) # => Tue, 16 Feb 2016
fri_before_family_day.workdays_after(1, :ca_qc) # => Mon, 15 Feb 2016
Workdays.workdays_in(fri_before_family_day, family_day, :ca_on) # => 1
Workdays.workdays_in(fri_before_family_day, family_day, :ca_qc) # => 2
Bug reports and pull requests are welcome on GitHub at https://github.com/julienroger/workdays.
Copyright (c) 2017 Julien Roger
FAQs
Unknown package
We found that workdays demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.