# HG changeset patch # User HIROSE Yuuji # Date 1076817734 -32378 # Node ID 84d3608bb529d61ebd7fa7a42c74fd5c7bc3aab8 # Parent b2f1a9482975d724435a7faca685d8ec7f7463b7 RCS-revision 1.12 date: 2004/02/15 13:01:52; author: yuuji; state: Exp; lines: +10 -4 Notify message fixed diff -r b2f1a9482975 -r 84d3608bb529 after5.rb --- a/after5.rb Sun Feb 08 15:43:59 2004 +0859 +++ b/after5.rb Sun Feb 15 13:01:52 2004 +0859 @@ -2,8 +2,8 @@ # # Associative Scheduling Table - after5 # (C)2003, 2004 by HIROSE Yuuji [yuuji@gentei.org] -# $Id: after5.rb,v 1.11 2004/02/08 15:43:59 yuuji Exp $ -# Last modified Mon Feb 9 00:33:48 2004 on firestorm +# $Id: after5.rb,v 1.12 2004/02/15 13:01:52 yuuji Exp $ +# Last modified Sat Feb 14 22:33:40 2004 on firestorm # See http://www.gentei.org/~yuuji/software/after5/ # このスクリプトはEUCで保存してください。 @@ -2188,15 +2188,21 @@ content = datehash.sort.collect{|date, filehash| next unless /(\d\d\d\d+)-(\d+)-(\d+)-(\d\d\d\d)/ =~ date y, m, d, t = $1.to_i, $2.to_i, $3.to_i, $4.to_i + ddiff=(Time.mktime(y, m, d) \ + - Time.mktime(now.year, now.month, now.day))/3600/24 if t > 2359 hhmm = msg('allday') - comment = msg(now.hour > 18 ? 'precedingday' : 'theday') + if ddiff > 1 + comment = "%d%s" % [ddiff, msg('days', 'before')] + else + comment = msg(now.hour > 18 ? 'precedingday' : 'theday') + end else hhmm = sprintf "%02d:%02d", t/100, t%100 diff = Time.mktime(y, m, d, t/100, t%100) - now if diff < 7200 comment = "%d%s" % [diff/60, msg('minutes', 'before')] - elsif (ddiff=(Time.mktime(y, m, d)-Time.mktime(now.year, now.month, now.day))/3600/24) == 0 + elsif (ddiff == 0) comment = "%s%d%s" % [msg('about'), diff/3600, msg('hours', 'before')] else