2012-08-15 38 views

回答

0

嘗試(未測試):

first_day = Date.parse("September 30, 2012") 
last_day = Date.parse("November 1, 2012") 
first_day.business_days_until(last_day) 
+0

它給2012年7月的21個工作日內,而他們是22 – 2012-08-16 06:22:31

+0

對不起你在上月的最後一天開始,否則第一一天不算。 – Ben 2012-08-16 07:39:07

+0

我使用了 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