Skip to content

Instantly share code, notes, and snippets.

View iL53n's full-sized avatar

Illia Hrybko iL53n

  • EPAM Systems @epam
  • Poland, Krakow
View GitHub Profile
@lbvf50mobile
lbvf50mobile / working_days.rb
Created August 23, 2019 12:31
working days for @iL53n
require 'date'
start_date = Date.new(2019,8,23)
finish_date = Date.new(2019,9,23)
date = start_date.clone
count_working_days = 0
count_working_days += 1 if /[^67]/ === date.strftime('%u')
while true do
date += 1
count_working_days += 1 if /[^67]/ === date.strftime('%u')
break if date == finish_date