# HG changeset patch # User HIROSE Yuuji # Date 1354152081 -32400 # Node ID 6a0c2f85faa348e6ee8f0ee8ff294f50494230e1 # Parent 156f315f52b881ce19bc66e3fe72fffa702bd5b7 Canonicalize arguments for isHoliday(), which will be sent to Time.mktime(). diff -r 156f315f52b8 -r 6a0c2f85faa3 after5.rb --- a/after5.rb Thu Jul 26 19:25:07 2012 +0900 +++ b/after5.rb Thu Nov 29 10:21:21 2012 +0900 @@ -4,7 +4,7 @@ # Associative Scheduling Table - after5 # (C)2003, 2004, 2006, 2008, 2012 by HIROSE Yuuji [yuujigentei.org] # $Id: after5.rb,v 1.19 2012/04/01 11:52:25 yuuji Exp yuuji $ -# Last modified Thu Jul 26 19:24:15 2012 on firestorm +# Last modified Thu Nov 29 10:17:51 2012 on firestorm # See http://www.gentei.org/~yuuji/software/after5/ # このスクリプトはEUCで保存してください。 $hgid = <<_HGID_.split[1..-2].join(" ") @@ -834,7 +834,7 @@ user = @usermap.keys.grep(user)[0] end next unless user - ud = File.join(dd, user) + ud = File.join(dd, user).untaint next unless test(?d, ud) ntl[user] = {} Dir.foreach(ud){|date| @@ -1847,10 +1847,12 @@ ## p day, last while column <= last @O.print @H.elementln("tr", nil){ + sunday = first + (column-1)*3600 (column..column+6).collect{|d| todayp = (day.year==todayy && day.month==todaym && d==todayd) wd=d-column - hd = holiday.isHoliday(day.year, day.month, d, wd) + thisday = sunday+3600*wd + hd = holiday.isHoliday(thisday.year, thisday.month, thisday.day, wd) tdclass['class'] = (hd ? 'holiday' : wname[wd]) @H.element("td", tdclass){ if d>0