0
我在ROR
新的,我想編寫一個函數,而我將通過month
,它將返回total working days
(除週六,週日)使用business_time
該月份的寶石在軌計算一個月工作日使用軌道BUSINESS_TIME寶石
我在ROR
新的,我想編寫一個函數,而我將通過month
,它將返回total working days
(除週六,週日)使用business_time
該月份的寶石在軌計算一個月工作日使用軌道BUSINESS_TIME寶石
嘗試(未測試):
first_day = Date.parse("September 30, 2012")
last_day = Date.parse("November 1, 2012")
first_day.business_days_until(last_day)
它給2012年7月的21個工作日內,而他們是22 – 2012-08-16 06:22:31
對不起你在上月的最後一天開始,否則第一一天不算。 – Ben 2012-08-16 07:39:07
我使用了 start_date = Date.parse(「2012年3月1日」); end_date = Date.parse(「2012年3月31日」)。at_beginning_of_month.next_month; start_date.business_days_until(end_date); – 2012-08-16 09:03:52