~niklaseklund/egerrit

dabf0e972cd3a539a87f4c97548cad197ddac083 — Niklas Eklund 3 months ago 6a8a986
Adjusts times to the timezone of the localhost
2 files changed, 13 insertions(+), 6 deletions(-)

M egerrit-core.el
M egerrit-job.el
M egerrit-core.el => egerrit-core.el +12 -5
@@ 178,8 178,8 @@ Send message SUCCESS-MESSAGE upon success."
     :project .project
     :subject .subject
     :status .status
     :created .created
     :updated .updated
     :created (egerrit--compensate-time-with-timezone .created)
     :updated (egerrit--compensate-time-with-timezone .updated)
     :topic .topic
     :work-in-progress .work_in_progress
     :owner (egerrit--create-user .owner)


@@ 201,8 201,8 @@ Send message SUCCESS-MESSAGE upon success."
       :changeid egerrit--current-change-id
       :subject .subject
       :status .status
       :created .created
       :updated .updated
       :created (egerrit--compensate-time-with-timezone .created)
       :updated  (egerrit--compensate-time-with-timezone .updated)
       :conversations (egerrit-get-conversations egerrit--current-change-id)
       :unresolved-comments .unresolved_comment_count
       :number egerrit--current-change-number


@@ 246,7 246,7 @@ Send message SUCCESS-MESSAGE upon success."
                                (egerrit--revision-create
                                 :id egerrit--current-revision-id
                                 :number egerrit--current-revision-number
                                 :created .created
                                 :created (egerrit--compensate-time-with-timezone .created)
                                 :uploader (egerrit--create-user .uploader)
                                 :ref .ref
                                 :fetch (egerrit--create-fetch .fetch)


@@ 367,6 367,13 @@ Optionally provide a NAME-CONTAIN variable to narrow the search space."
   (egerrit-change-id change)
   reviewer))

(defun egerrit--compensate-time-with-timezone (utc-time)
  "Compensate UTC-TIME to time-zone on the local-host."
  (let ((time-zone (current-time-zone)))
    (format-time-string "%Y-%m-%d %H:%M:%S %z"
                        (time-add (date-to-time utc-time)
                                  (car time-zone)))))

(provide 'egerrit-core)

;;; egerrit-core.el ends here

M egerrit-job.el => egerrit-job.el +1 -1
@@ 237,7 237,7 @@ Optionally provide a REVISION to select job from."
                               :status (downcase (match-string 3 line))
                               :time (match-string 4 line)
                               :revision revision
                               :date (egerrit--message-date message)))))
                               :date (egerrit--compensate-time-with-timezone (egerrit--message-date message))))))
                 (seq-remove #'null))))

(defun egerrit--sort-jobs (jobs)