branch: elpa/casual
commit 2d3e83071fcb042bd91859adcd4c70e66f381f6a
Merge: e9ea7221de 817e87d0cf
Author: Charles Choi <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #228 from kickingvegas/225-casual-timezone-error
    
    Fix for bad argument for date-to-time
---
 lisp/casual-timezone-utils.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/casual-timezone-utils.el b/lisp/casual-timezone-utils.el
index 8dae47eb90..aeb68dd47a 100644
--- a/lisp/casual-timezone-utils.el
+++ b/lisp/casual-timezone-utils.el
@@ -166,13 +166,13 @@ The format of the timestamp is defined in the variable
                          (casual-timezone-zone-info))))
          (parse-ts (string-split datestr))
          (datestamp (nth 0 parse-ts))
-         (timestamp (nth 1 parse-ts))
+         (timestamp (or (nth 1 parse-ts) "00:00"))
          (local-tz (nth 1 (current-time-zone)))
          (remote-time
           (format-time-string
            casual-timezone-convert-datestamp-format
            (date-to-time
-            (concat datestamp "T" timestamp ":00" " " local-tz))
+            (concat datestamp " " timestamp ":00" " " local-tz))
            remote-tz))
          (remote-time-tz (concat remote-tz " " remote-time)))
     (kill-new remote-time-tz)
@@ -204,12 +204,12 @@ The format of the timestamp is defined in the variable
                   (nth 0 (current-time-zone nil remote-tz))))
          (parse-ts (string-split datestr))
          (datestamp (nth 0 parse-ts))
-         (timestamp (nth 1 parse-ts))
+         (timestamp (or (nth 1 parse-ts) "00:00"))
          ;; (local-tz (nth 1 (current-time-zone)))
          (index-time
           (format-time-string
            casual-timezone-convert-datestamp-format
-           (date-to-time (concat datestamp "T" timestamp ":00" " " tzcode)))))
+           (date-to-time (concat datestamp " " timestamp ":00" " " tzcode)))))
     (kill-new index-time)
     (message index-time)
     index-time))

Reply via email to