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

[mhc:00582] Re: mhc-snap20000509



From: Yoshinari NOMURA <nom@xxxxxxxxxxxxxxxxxxx> さん曰く
Subject: [mhc:00579] mhc-snap20000509
Message-ID: <20000509123559I.nom@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 9 May 2000 12:36:02 +0900

乃村>    + mhc-date.el のバグ修正

もう一丁です。

patch 前
(ddate-mm-inc '(2000 1 31)) => (2000 2 31)
(ddate-mm-dec '(2000 5 31)) => (2000 4 31)

patch 後
(ddate-mm-inc '(2000 1 31)) => (2000 2 29)
(ddate-mm-dec '(2000 5 31)) => (2000 4 30)

こうなるのって、日付がオーバしたときしか無いとは思います。

-- 
白井秀行 (mailto:shirai@xxxxxxxxxxxxxxxxxxx)

--- mhc-date.el.orig	Tue May  9 12:28:08 2000
+++ mhc-date.el	Tue May  9 17:35:39 2000
@@ -350,7 +350,9 @@
     (setq xx (+ mm c))
     (setq pp (if (< 0 xx ) (/ (- xx  1) 12) (/ (- xx 12) 12)))
     (setq yy (+ yy pp) mm (- xx (* 12 pp)))
-    (list yy mm (nth 2 ddate))))
+    (if (ddate-parse (list yy mm (nth 2 ddate)))
+	(list yy mm (nth 2 ddate))
+      (list yy mm (ddate-days-of-mm (list yy mm 1))))))
 
 (defun ddate-mm-dec (ddate &optional c)
   (ddate-mm-inc ddate (if c (- c) -1)))