user2310209
user2310209

Reputation: 1002

how to find number of working days for particular month in rails

I am having problem in calculating number of working days for particular month. I have attendance model.which contains, school_id,course_id,section_id,student_id,attendance_date attributes.These fields for making attendance for particular section in particular school

For viewing attendance report, I have school,course,section and month fields.when I select the month it will show the number of working days for that particular month.So, I have to calculate working days by attendance_date field from attendance model. I am having confusion in that. Please help me.

Upvotes: 3

Views: 2352

Answers (1)

Pierre-Louis Gottfrois
Pierre-Louis Gottfrois

Reputation: 17631

You might want to take a look at business_time

Example:

4.business_days.from_now
8.business_days.after(some_date)

Upvotes: 2

Related Questions