Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix datemark calculation not taking into account local time #7678

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/status_im/utils/datetime.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(ns status-im.utils.datetime
(:require [re-frame.core :as re-frame]
[cljs-time.core :as t :refer [date-time plus days hours before?]]
[cljs-time.core :as t :refer [date-time plus minus days hours before?]]
[cljs-time.coerce :refer [from-long to-long from-date]]
[cljs-time.format :refer [formatters
formatter
Expand Down Expand Up @@ -80,7 +80,7 @@
(defn- to-str [ms old-fmt-fn yesterday-fmt-fn today-fmt-fn]
(let [date (from-long ms)
local (plus date time-zone-offset) ; this is wrong, it uses the current timezone offset, regardless of DST
today (t/today-at-midnight)
today (minus (t/today-at-midnight) time-zone-offset)
yesterday (plus today (days -1))]
(cond
(before? date yesterday) (old-fmt-fn local)
Expand Down