Created
November 8, 2012 19:19
-
-
Save pote/4040908 to your computer and use it in GitHub Desktop.
Simple script to calculate how far from my target hours whenever I want to.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
today = Date.today | |
beginning_of_month = Date.parse("#{today.year}-#{today.month}-1") | |
workable_days_until_now = (beginning_of_month..today).reject { |d| d.saturday? || d.sunday? }.count | |
optimum_hours_until_now = workable_days_until_now * 6 | |
puts "Workable days until now: #{ workable_days_until_now }" | |
puts "Optimum hours until now: #{ optimum_hours_until_now }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mmm, interesting...