2012-08-15 64 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