subscription create dates

This commit is contained in:
Fran Jurmanović
2021-06-19 14:26:21 +02:00
parent 6fa3c9266c
commit e5fa8d463c

View File

@@ -10,6 +10,7 @@ import {
import { AppFormElement, InputFieldElement } from 'components/';
import { BasePageElement } from 'common/';
import { AppDropdownElement } from 'components/app-dropdown/AppDropdownElement';
import dayjs from 'dayjs';
@controller
class SubscriptionCreateElement extends BasePageElement {
@@ -113,14 +114,22 @@ class SubscriptionCreateElement extends BasePageElement {
customRange,
transactionType: transactionTypeId,
subscriptionType: subscriptionTypeId,
startDate,
endDate,
} = values;
const startDateFormat = dayjs(startDate).format();
const endDateFormat = dayjs(endDate).format();
const walletData = this.walletData;
const formData = {
description,
amount,
customRange: customRange || 0,
hasEnd: (this.hasEndCheck?.inp as HTMLInputElement)?.checked,
startDate: startDateFormat,
endDate: endDateFormat,
walletId: walletData && walletData.walletId ? walletData.walletId : walletId,
transactionTypeId:
walletData && walletData.transactionTypeId ? walletData.transactionTypeId : transactionTypeId,