Created
May 25, 2016 13:22
-
-
Save Pluto1010/08fd1a887b3e27d6464e53e92154bbb7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'date' | |
bank_holidays = {} | |
bank_holidays['Neujahr'] = '01.01.2016' | |
bank_holidays['Karfreitag'] = '25.03.2016' | |
bank_holidays['Ostermontag'] = '28.03.2016' | |
bank_holidays['Maifeiertag'] = '01.05.2016' | |
bank_holidays['Christi Himmelfahrt'] = '05.05.2016' | |
bank_holidays['Pfingstmontag'] = '16.05.2016' | |
bank_holidays['Fronleichnam'] = '26.05.2016' | |
bank_holidays['Tag der Deutschen Einheit'] = '03.10.2016' | |
bank_holidays['Allerheiligen'] = '01.11.2016' | |
bank_holidays['1. Weihnachtstag'] = '25.12.2016' | |
bank_holidays['2. Weihnachtstag'] = '26.12.2016' | |
start_date = Date.parse ARGV[0] | |
actual_date = start_date | |
while actual_date < Date.today | |
actual_date = actual_date + 1 | |
next if actual_date.strftime('%u').to_i > 5 | |
next if bank_holidays.values.include? actual_date.strftime('%d.%m.%Y') | |
puts actual_date | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment