fix currentDate

This commit is contained in:
vchikalkin 2023-04-17 13:31:35 +03:00
parent 86bdfe961e
commit 501c818119
11 changed files with 15 additions and 18 deletions

View File

@ -22,7 +22,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
return;
}
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
const {
data: { evo_addproduct_types },
@ -79,7 +79,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
reaction(
() => $calculation.$values.getValues(['leasingPeriod', 'leaseObjectType']),
async ({ leasingPeriod, leaseObjectType }) => {
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
const {
data: { evo_addproduct_types },
@ -163,7 +163,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
leasingPeriod,
plPriceRub,
}) => {
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
const {
data: { evo_addproduct_types },
@ -242,7 +242,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
reaction(
() => $calculation.$values.getValues(['requirementTelematic', 'recalcWithRevision']),
async ({ requirementTelematic, recalcWithRevision }) => {
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
const {
data: { evo_addproduct_types: trackerTypes },
} = await apolloClient.query({

View File

@ -25,7 +25,7 @@ export default function helper({ apolloClient, user }: ValidationContext) {
return null;
}
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
const {
data: { evo_coefficients },

View File

@ -337,7 +337,7 @@ export default function reactions({ store, apolloClient, user }: ProcessContext)
reaction(
() => $calculation.element('selectQuote').getValue(),
async (quoteId) => {
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
let {
data: { evo_baseproducts },

View File

@ -33,7 +33,7 @@ export default function valuesReactions({ store, apolloClient }: ProcessContext)
lastPaymentPerc,
leaseObjectType: leaseObjectTypeId,
}) => {
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
let {
data: { evo_tarifs = [] },
@ -137,7 +137,7 @@ export default function valuesReactions({ store, apolloClient }: ProcessContext)
return;
}
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
const {
data: { evo_rates },

View File

@ -148,7 +148,7 @@ export default function reactions({ store, apolloClient, queryClient }: ProcessC
>({
query: QUERY_GET_FINGAP_ADDPRODUCT_TYPES,
variables: {
currentDate: dayjs().utc(false).format('YYYY-MM-DD'),
currentDate: dayjs().utc(false).toISOString(),
},
});

View File

@ -241,7 +241,7 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
leaseObjectType,
// eslint-disable-next-line sonarjs/cognitive-complexity
}) => {
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
let evo_region: CRMTypes.GetRegionQuery['evo_region'];
if (objectRegionRegistrationId) {

View File

@ -9,7 +9,7 @@ import { useEffect } from 'react';
dayjs.extend(utc);
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
/**
*
@ -19,9 +19,6 @@ const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
function getMainData({ query }, onCompleted) {
query({
query: CRMTypes.GetLeaseObjectTypesDocument,
variables: {
currentDate,
},
}).then(({ data }) => {
onCompleted({
selectLeaseObjectType: data?.evo_leasingobject_types,

View File

@ -66,7 +66,7 @@ export function common({ store, apolloClient }: ProcessContext) {
firstPaymentPerc,
model: modelId,
}) => {
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const currentDate = dayjs().utc(false).toISOString();
const {
data: { evo_addproduct_types },

View File

@ -35,7 +35,7 @@ export function fillAgentRewardReaction(
query: CRMTypes.GetRewardConditionsDocument,
variables: {
agentid,
currentDate: dayjs().utc(false).format('YYYY-MM-DD'),
currentDate: dayjs().utc(false).toISOString(),
},
});

View File

@ -32,7 +32,7 @@ function helper({ apolloClient, ctx }: ValidationContext & { ctx: RefinementCtx
query: CRMTypes.GetRewardConditionsDocument,
variables: {
agentid,
currentDate: dayjs().utc(false).format('YYYY-MM-DD'),
currentDate: dayjs().utc(false).toISOString(),
},
});

View File

@ -36,7 +36,7 @@ export function createCurrencyUtility({ apolloClient }: Context) {
fetchPolicy: 'network-only',
query: CRMTypes.GetCurrencyChangesDocument,
variables: {
currentDate: dayjs().utc(false).format('YYYY-MM-DD'),
currentDate: dayjs().utc(false).toISOString(),
},
});