# HG changeset patch # User Thien-Thi Nguyen # Date 1073604792 0 # Node ID f34089e632fc8dac71ae5dee2843e8c093537b2e # Parent 65fe9b0d6ac6db3d50b894cad1cc4cdf4f6a8096 (appt-add): Also accept time in the form XX[.XX][am/pm/AM/PM]. (appt-make-list): Likewise. (appt-convert-time): Likewise. diff -r 65fe9b0d6ac6 -r f34089e632fc lisp/calendar/appt.el --- a/lisp/calendar/appt.el Thu Jan 08 23:31:47 2004 +0000 +++ b/lisp/calendar/appt.el Thu Jan 08 23:33:12 2004 +0000 @@ -437,7 +437,8 @@ The time should be in either 24 hour format or am/pm format." (interactive "sTime (hh:mm[am/pm]): \nsMessage: ") - (if (string-match "[0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?" new-appt-time) + (if (string-match "[0-9]?[0-9][:.][0-9][0-9]\\(am\\|pm\\)?" + new-appt-time) nil (error "Unacceptable time-string")) @@ -519,7 +520,7 @@ (calendar-current-date) (car (car entry-list)))) (let ((time-string (cadr (car entry-list)))) (while (string-match - "\\([0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?\\).*" + "\\([0-9]?[0-9][:.][0-9][0-9]\\(am\\|pm\\)?\\).*" time-string) (let* ((beg (match-beginning 0)) ;; Get just the time for this appointment. @@ -527,7 +528,7 @@ ;; Find the end of this appointment ;; (the start of the next). (end (string-match - "^[ \t]*[0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?" + "^[ \t]*[0-9]?[0-9][:.][0-9][0-9]\\(am\\|pm\\)?" time-string (match-end 0))) ;; Get the whole string for this appointment. @@ -586,17 +587,17 @@ (defun appt-convert-time (time2conv) - "Convert hour:min[am/pm] format to minutes from midnight." - + "Convert hour:min[am/pm] format to minutes from midnight. +Also try to accept the hour.min[am/pm] format." (let ((conv-time 0) (hr 0) (min 0)) - (string-match ":\\([0-9][0-9]\\)" time2conv) + (string-match "[:.]\\([0-9][0-9]\\)" time2conv) (setq min (string-to-int (match-string 1 time2conv))) - (string-match "[0-9]?[0-9]:" time2conv) + (string-match "[0-9]?[0-9][:.]" time2conv) (setq hr (string-to-int (match-string 0 time2conv)))