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