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

[mhc:01896] Re: 英文日付の取り込み



森下です。

From: Yoshinari Nomura <nom@xxxxxxxxxxxxx>
Subject: [mhc:01895] Re: 英文日付の取り込み
Date: Wed, 31 Mar 2004 19:49:48 +0900
Message-ID: <20040331194948Z.nom@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>

> [mhc:01893] で森下さんより頂いたパッチを commit しておきました.

ありがとうございます。

最近受け取ったメールで、日付部分が APR 09, 04 のように、月の名前がすべ
て大文字、年の部分が西暦下 2 桁、というものがあり、これを誤って解釈し
てしまっていました。
このバグに対する CVS head へのパッチを作成しましたので、お送りいたしま
す。

Index: mhc-guess.el
===================================================================
RCS file: /cvsroot/mhc/emacs/mhc-guess.el,v
retrieving revision 1.18
diff -c -r1.18 mhc-guess.el
*** mhc-guess.el	2004/03/31 10:43:47	1.18
--- mhc-guess.el	2004/04/01 05:31:56
***************
*** 104,110 ****
   		   "\\([0-90-9]+\\)日?\\(間\\)?"
  	      "\\)?")
       mhc-guess/make-date-from-mmdd 2 3 8 9 10)
!     
      ;; USA style date format
      (,(concat "\\(Jan\\(uary\\)?\\|Feb\\(ruary\\)?\\|Mar\\(ch\\)?\\|"
  	      "Apr\\(il\\)?\\|May\\|June?\\|July?\\|Aug\\(ust\\)?\\|"
--- 104,110 ----
   		   "\\([0-90-9]+\\)日?\\(間\\)?"
  	      "\\)?")
       mhc-guess/make-date-from-mmdd 2 3 8 9 10)
! 
      ;; USA style date format
      (,(concat "\\(Jan\\(uary\\)?\\|Feb\\(ruary\\)?\\|Mar\\(ch\\)?\\|"
  	      "Apr\\(il\\)?\\|May\\|June?\\|July?\\|Aug\\(ust\\)?\\|"
***************
*** 403,417 ****
  	  '(("Jan" . "1") ("Feb" . "2") ("Mar" . "3") ("Apr" . "4")
  	    ("May" . "5") ("Jun" . "6") ("Jul" . "7") ("Aug" . "8")
  	    ("Sep" . "9") ("Oct" . "10") ("Nov" . "11") ("Dec" . "12")))
! 	 (mm-str (cdr (assoc (substring month-str 0 3) month-alist)))
  	 (yy-length (length yy-str)))
      (cond ((= yy-length 4)		; "yyyy"
  	   (mhc-guess/make-date-from-yyyymmdd now yy-str mm-str dd-str))
! 	  ((= yy-length 3)		; "'yy"
  	   (mhc-guess/make-date-from-yyyymmdd
  	    now
  	    (concat (substring (format-time-string "%Y") 0 2)
! 		    (substring yy-str 1 3))
  	    mm-str dd-str))
  	  (t
  	   (mhc-guess/make-date-from-mmdd now mm-str dd-str)))))
--- 403,418 ----
  	  '(("Jan" . "1") ("Feb" . "2") ("Mar" . "3") ("Apr" . "4")
  	    ("May" . "5") ("Jun" . "6") ("Jul" . "7") ("Aug" . "8")
  	    ("Sep" . "9") ("Oct" . "10") ("Nov" . "11") ("Dec" . "12")))
! 	 (mm-str (cdr (assoc (capitalize (substring month-str 0 3))
! 			     month-alist)))
  	 (yy-length (length yy-str)))
      (cond ((= yy-length 4)		; "yyyy"
  	   (mhc-guess/make-date-from-yyyymmdd now yy-str mm-str dd-str))
! 	  ((or (= yy-length 3) (= yy-length 2)) ; "'yy" or "yy"
  	   (mhc-guess/make-date-from-yyyymmdd
  	    now
  	    (concat (substring (format-time-string "%Y") 0 2)
! 		    (substring yy-str -2))
  	    mm-str dd-str))
  	  (t
  	   (mhc-guess/make-date-from-mmdd now mm-str dd-str)))))
***************
*** 487,493 ****
  	       (t
  		nil)))
         (cdr (assoc-ignore-case dow dow-alist))))))
! 		
  ;;
  ;; make time from string.
  ;;
--- 488,494 ----
  	       (t
  		nil)))
         (cdr (assoc-ignore-case dow dow-alist))))))
! 
  ;;
  ;; make time from string.
  ;;

よろしくお願いいたします。

--
もりした みんぺい