How to calculate next, previous business day in Rails?

前端 未结 12 2333
粉色の甜心
粉色の甜心 2021-02-08 08:43

How to calculate next and previous business days in Rails?

12条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-08 09:12

    Here's two examples for the number of working days between two dates:

    1. http://codesnippets.joyent.com/posts/show/1209
      • Also at: http://www.railsonwave.com/2007/1/30/calculate-the-number-of-working-days-between-two-dates
    2. http://www.ruby-forum.com/topic/93938#190402

    Here's a Ruby holidays gem:

    • http://github.com/alexdunae/holidays
      • Also at: http://code.dunae.ca/holidays/

提交回复
热议问题