IO-2371 Closing period timezone adjustments
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
Switch,
|
||||
Upload,
|
||||
} from "antd";
|
||||
import moment from "moment";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { MdOpenInNew } from "react-icons/md";
|
||||
@@ -271,10 +272,20 @@ export function BillFormComponent({
|
||||
bodyshop.accountingconfig.ClosingPeriod
|
||||
) {
|
||||
if (
|
||||
Date.parse(value).valueOf() >=
|
||||
Date.parse(bodyshop.accountingconfig.ClosingPeriod[0]).valueOf() &&
|
||||
Date.parse(value).valueOf() <=
|
||||
Date.parse(bodyshop.accountingconfig.ClosingPeriod[1]).valueOf()
|
||||
moment(value)
|
||||
.startOf("day")
|
||||
.isSameOrAfter(
|
||||
moment(
|
||||
bodyshop.accountingconfig.ClosingPeriod[0]
|
||||
).startOf("day")
|
||||
) &&
|
||||
moment(value)
|
||||
.startOf("day")
|
||||
.isSameOrBefore(
|
||||
moment(
|
||||
bodyshop.accountingconfig.ClosingPeriod[1]
|
||||
).endOf("day")
|
||||
)
|
||||
) {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user