count working days in month

/ Published in: Ruby
Save to your folder(s)

Copy this code and paste it in your HTML
  1. d1 =,, 1) #first day of month\period
  2. d2 =,, -1) #end day of month\period
  3. wdays = [0,6] #weekend days by numbers on week
  4. weekdays = (d1..d2).reject { |d| wdays.include? d.wday} #Day.wday number day in week

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.