IO-1708 Add shop timezone & update server side calculations.
This commit is contained in:
@@ -38,6 +38,7 @@ export default function DashboardMonthlyEmployeeEfficiency({
|
||||
if (!!ticketsByDate[val]) {
|
||||
dailyHrs = ticketsByDate[val].reduce(
|
||||
(dayAcc, dayVal) => {
|
||||
console.log(dayAcc);
|
||||
return {
|
||||
actual: dayAcc.actual + dayVal.actualhrs,
|
||||
productive: dayAcc.actual + dayVal.productivehrs,
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
import { DatePicker } from "antd";
|
||||
import moment from "moment";
|
||||
import moment from "moment-timezone";
|
||||
import React, { useRef } from "react";
|
||||
//To be used as a form element only.
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(FormDatePicker);
|
||||
|
||||
const dateFormat = "MM/DD/YYYY";
|
||||
|
||||
export default function FormDatePicker({
|
||||
export function FormDatePicker({
|
||||
bodyshop,
|
||||
value,
|
||||
onChange,
|
||||
onBlur,
|
||||
@@ -23,7 +36,7 @@ export default function FormDatePicker({
|
||||
const handleKeyDown = (e) => {
|
||||
if (e.key.toLowerCase() === "t") {
|
||||
if (onChange) {
|
||||
onChange(new moment());
|
||||
onChange(moment());
|
||||
// if (ref.current && ref.current.blur) ref.current.blur();
|
||||
}
|
||||
} else if (e.key.toLowerCase() === "enter") {
|
||||
|
||||
@@ -65,6 +65,7 @@ export function ScheduleCalendarContainer({ calculateScheduleLoad }) {
|
||||
color: "red",
|
||||
start: moment(e.start).startOf("day").toDate(),
|
||||
end: moment(e.end).startOf("day").toDate(),
|
||||
allDay: true,
|
||||
vacation: true,
|
||||
};
|
||||
}),
|
||||
|
||||
@@ -19,6 +19,9 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||
import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
||||
|
||||
import momentTZ from "moment-timezone";
|
||||
const timeZonesList = momentTZ.tz.names();
|
||||
|
||||
export default function ShopInfoGeneral({ form }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
@@ -84,6 +87,7 @@ export default function ShopInfoGeneral({ form }) {
|
||||
<Form.Item label={t("bodyshop.fields.email")} name="email">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.phone")}
|
||||
name="phone"
|
||||
@@ -97,6 +101,23 @@ export default function ShopInfoGeneral({ form }) {
|
||||
<Form.Item label={t("bodyshop.fields.website")} name="website">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.timezone")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
//message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
name="timezone"
|
||||
>
|
||||
<Select
|
||||
showSearch
|
||||
options={timeZonesList.map((z) => {
|
||||
return { label: z, value: z };
|
||||
})}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.insurance_vendor_id")}
|
||||
name="insurance_vendor_id"
|
||||
|
||||
Reference in New Issue
Block a user