IO-1708 Revert timezone change in app

This commit is contained in:
Patrick Fic
2022-02-11 08:24:34 -08:00
parent 85ccb36b2e
commit 75b2398421
3 changed files with 25 additions and 7 deletions

View File

@@ -71,7 +71,7 @@ export function FormDatePicker({
<div onKeyDown={handleKeyDown}>
<DatePicker
ref={ref}
value={value ? moment(value).tz(bodyshop.timezone) : null}
value={value ? moment(value) : null}
onChange={handleChange}
format={dateFormat}
onBlur={onBlur || handleBlur}

View File

@@ -1,5 +1,7 @@
import { CalendarOutlined } from "@ant-design/icons";
import { Card, Col, Row, Statistic } from "antd";
import _ from "lodash";
import moment from "moment";
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -7,8 +9,6 @@ import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import ScoreboardJobsList from "../scoreboard-jobs-list/scoreboard-jobs-list.component";
import * as Util from "./scoreboard-targets-table.util";
import _ from "lodash";
import moment from "moment";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -39,7 +39,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
toDatePaint: 0,
};
const today = moment().tz(bodyshop.timezone);
const today = moment();
if (dateHash[today.format("YYYY-MM-DD")]) {
dateHash[today.format("YYYY-MM-DD")].forEach((d) => {
ret.todayBody = ret.todayBody + d.bodyhrs;
@@ -47,7 +47,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
});
}
let StartOfWeek = moment().tz(bodyshop.timezone).startOf("week");
let StartOfWeek = moment().startOf("week");
while (StartOfWeek.isSameOrBefore(today)) {
if (dateHash[StartOfWeek.format("YYYY-MM-DD")]) {
dateHash[StartOfWeek.format("YYYY-MM-DD")].forEach((d) => {
@@ -58,7 +58,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
StartOfWeek = StartOfWeek.add(1, "day");
}
let startOfMonth = moment().tz(bodyshop.timezone).startOf("month");
let startOfMonth = moment().startOf("month");
while (startOfMonth.isSameOrBefore(today)) {
if (dateHash[startOfMonth.format("YYYY-MM-DD")]) {
dateHash[startOfMonth.format("YYYY-MM-DD")].forEach((d) => {
@@ -70,7 +70,7 @@ export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) {
}
return ret;
}, [scoreBoardlist, bodyshop.timezone]);
}, [scoreBoardlist]);
console.log(
"🚀 ~ file: scoreboard-targets-table.component.jsx ~ line 51 ~ values ~ values",
values

View File

@@ -1172,6 +1172,11 @@ decode-uri-component@^0.2.0:
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
deeks@2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/deeks/-/deeks-2.5.1.tgz#c4e18a00cac3f8ff95a306463db8f533c879f436"
integrity sha512-fqrBeUz7f1UqaXDRzVB5RG2EfPk15HJRrb2pMZj8mLlSTtz4tRPsK5leFOskoHFPuyZ6+7aRM9j657fvXLkJ7Q==
deep-is@^0.1.3, deep-is@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
@@ -1213,6 +1218,11 @@ dinero.js@^1.9.1:
resolved "https://registry.yarnpkg.com/dinero.js/-/dinero.js-1.9.1.tgz#64b10ce7277a07805dac9c8cd6500e9b7d0aee96"
integrity sha512-1HXiF2vv3ZeRQ23yr+9lFxj/PbZqutuYWJnE0qfCB9xYBPnuaJ8lXtli1cJM0TvUXW1JTOaePldmqN5JVNxKSA==
doc-path@3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/doc-path/-/doc-path-3.0.2.tgz#a7df9d58eadce28a2ddd4eda5aa392628fd75b6d"
integrity sha512-VRlA2OKSjTbHWj6wmSanxJ338fE/YN8pqmZ0FIWK5JWkIJMFRc4KmD35JtOrnjvVG0WrzOtDDNHx1lN1tkb+lA==
doctrine@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
@@ -2346,6 +2356,14 @@ jsbn@~0.1.0:
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM=
json-2-csv@^3.17.0:
version "3.17.0"
resolved "https://registry.yarnpkg.com/json-2-csv/-/json-2-csv-3.17.0.tgz#d886e4ec382bdb96dd31cbf87e0206173176d3c7"
integrity sha512-mLnrYK3TX/mDSiBduA6vuSuVlvkYgDMv+Ef8HXCriyz73BBc6I7pWljdRfR+FKPzYKcnz/rUvzbqJQx/tbEoMQ==
dependencies:
deeks "2.5.1"
doc-path "3.0.2"
json-bigint@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1"