use dayjs().utc(false).format('YYYY-MM-DD')

This commit is contained in:
vchikalkin 2023-03-02 13:45:04 +03:00
parent 581410138c
commit f93426767c
8 changed files with 17 additions and 13 deletions

View File

@ -14,7 +14,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
reaction(
() => $calculation.$values.getValues(['leasingPeriod', 'leaseObjectType']),
async ({ leasingPeriod, leaseObjectType }) => {
const currentDate = dayjs().utc(false).toISOString();
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const {
data: { evo_addproduct_types },
@ -71,7 +71,7 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
reaction(
() => $calculation.$values.getValues(['leasingPeriod', 'leaseObjectType']),
async ({ leasingPeriod, leaseObjectType }) => {
const currentDate = dayjs().utc(false).toISOString();
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const {
data: { evo_addproduct_types },

View File

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

View File

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

View File

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

View File

@ -233,9 +233,13 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
},
context
);
const { tax, error } = await queryClient.fetchQuery(['1c', 'trans-tax'], request, {
staleTime: STALE_TIME,
});
const { tax, error } = await queryClient.fetchQuery(
['1c', 'trans-tax', carCategory, leaseObjectMotorPower, leaseObjectYear],
request,
{
staleTime: STALE_TIME,
}
);
if (!error && tax) {
$calculation.element('tbxVehicleTaxInYear').setValue(tax);
@ -273,7 +277,7 @@ export function common({ store, apolloClient, queryClient }: ProcessContext) {
return;
}
const currentDate = dayjs().utc(false).toISOString();
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
const {
data: { evo_region },

View File

@ -9,7 +9,7 @@ import { normalizeOptions } from 'tools';
dayjs.extend(utc);
const currentDate = dayjs().utc(false).toISOString();
const currentDate = dayjs().utc(false).format('YYYY-MM-DD');
/**
*

View File

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

View File

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