mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 01:54:34 +03:00
Fix offset in react
This commit is contained in:
parent
19a1361020
commit
529d4f3018
@ -37,8 +37,9 @@ export function formatDay(date) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// https://stackoverflow.com/a/11124448
|
// https://stackoverflow.com/a/11124448
|
||||||
export function newDateInOffset(offset) {
|
export function newDateInOffset(siteOffset) {
|
||||||
return new Date(new Date().getTime() + offset * 1000)
|
const browserOffset = (new Date()).getTimezoneOffset() * 60
|
||||||
|
return new Date(new Date().getTime() + (siteOffset * 1000) + (browserOffset * 1000))
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isToday(site, date) {
|
export function isToday(site, date) {
|
||||||
|
@ -129,7 +129,10 @@ defmodule PlausibleWeb.SiteController do
|
|||||||
|
|
||||||
case res do
|
case res do
|
||||||
{:ok, site} ->
|
{:ok, site} ->
|
||||||
|
site_session_key = "authorized_site__" <> site.domain
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|
|> put_session(site_session_key, nil)
|
||||||
|> put_flash(:success, "Site settings saved succesfully")
|
|> put_flash(:success, "Site settings saved succesfully")
|
||||||
|> redirect(to: "/#{site.domain}/settings")
|
|> redirect(to: "/#{site.domain}/settings")
|
||||||
{:error, changeset} ->
|
{:error, changeset} ->
|
||||||
|
Loading…
Reference in New Issue
Block a user