diff options
| author | Lars Ingebrigtsen | 2019-07-30 16:59:31 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-07-31 21:47:29 +0200 |
| commit | 14c0a63e79ebb5c7445b3a4d2fe6e98e4a707765 (patch) | |
| tree | 00edd2ff4c3de3531cbcc51b7393a149cf87e306 | |
| parent | 46df7bbe12cce4c9af7ce4357aa9f8d36c1d8933 (diff) | |
| download | emacs-14c0a63e79ebb5c7445b3a4d2fe6e98e4a707765.tar.gz emacs-14c0a63e79ebb5c7445b3a4d2fe6e98e4a707765.zip | |
Make time-zone-format take a SHORT parameter
* lisp/calendar/time-date.el (time-zone-format): Accept an
optional SHORT parameter.
| -rw-r--r-- | lisp/calendar/time-date.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index efc9ae4e3b9..6f851712472 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el | |||
| @@ -352,14 +352,18 @@ is output until the first non-zero unit is encountered." | |||
| 352 | (<= (car here) delay))) | 352 | (<= (car here) delay))) |
| 353 | (concat (format "%.2f" (/ delay (car (cddr here)))) (cadr here)))))) | 353 | (concat (format "%.2f" (/ delay (car (cddr here)))) (cadr here)))))) |
| 354 | 354 | ||
| 355 | (defun time-zone-format (seconds) | 355 | (defun time-zone-format (seconds &optional short) |
| 356 | "Format SECONDS as a valid time zone string. | 356 | "Format SECONDS as a valid time zone string. |
| 357 | For instance, 3600 is \"+01:00\"." | 357 | For instance, 3600 is \"+01:00\". |
| 358 | (format "%s%02d:%02d" | 358 | If SHORT, the colon isn't included." |
| 359 | (format "%s%02d%s%02d" | ||
| 359 | (if (< seconds 0) | 360 | (if (< seconds 0) |
| 360 | "-" | 361 | "-" |
| 361 | "+") | 362 | "+") |
| 362 | (/ (abs seconds) 3600) | 363 | (/ (abs seconds) 3600) |
| 364 | (if short | ||
| 365 | "" | ||
| 366 | ":") | ||
| 363 | (mod (abs seconds) 3600))) | 367 | (mod (abs seconds) 3600))) |
| 364 | 368 | ||
| 365 | (defun date-days-in-month (year month) | 369 | (defun date-days-in-month (year month) |