[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mhc:00907] Re: X-SC-Cond Broken.



のむらです。

On Wed, 02 Aug 2000 16:53:54 +0900 (JST),
	Hideyuki SHIRAI (白井秀行) <shirai@xxxxxxxxxxxxx> said:

> たとえば、今年/今月の場合、
> 
> X-SC-Cond: 3rd Sun
> 
> は 08月20日(日) を期待しているのですが、08月13日(日) になります。
> 単純に何週目だけ見て、実際の曜日を見ていないようです。
> Gemcal などは大丈夫。

うひょー。branch したときから入ってました。

日曜日を超えたら、週が増えるようになってたのが原因のようです。
# 今年の成人の日と体育の日は、はたまたま OK なのね。:-)

RELENG_00 方面は OK のようです。すぐ commit します。
--
nom


Index: mhc-db.el
===================================================================
RCS file: /cvsroot/mhc/emacs/mhc-db.el,v
retrieving revision 1.9
diff -u -r1.9 mhc-db.el
--- mhc-db.el	2000/07/31 01:45:29	1.9
+++ mhc-db.el	2000/08/02 10:33:47
@@ -40,7 +40,7 @@
   (let (list new)
     (mhc-day-let from
       (let* ((day from)
-	     (week-of-month (/ (+ day-of-month day-of-week -8) 7))
+	     (week-of-month (/ (1- day-of-month) 7))
 	     ;; FIXME: mhc-date.el の内部関数を呼び出している。
 	     (last-day-of-month (mhc-date/last-day-of-month year month))
 	     (last-week (> 7 (- last-day-of-month day-of-month)))
@@ -67,8 +67,7 @@
 		    last-day-of-month (mhc-date/last-day-of-month year month)
 		    sexp-list (mhc-db/get-sexp-list-for-month year month))
 	    ;; 週末毎の処理
-	    (if (zerop day-of-week)
-		(setq week-of-month (1+ week-of-month)))
+	    (setq week-of-month (/ (1- day-of-month) 7))
 	    (and (not last-week)
 		 (> 7 (- last-day-of-month day-of-month))
 		 (setq last-week t)))))