Skip to content

Firefly III: a personal finances manager

Convert dates into date-times for #4571

James Colee221d37d2b3e
diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php
index 3f2f7f3c77..ad450c9ec1 100644
--- a/app/Transformers/AccountTransformer.php
+++ b/app/Transformers/AccountTransformer.php
@@ -103,7 +103,7 @@ class AccountTransformer extends AbstractTransformer
'currency_symbol' => $currencySymbol,
'currency_decimal_places' => $decimalPlaces,
'current_balance' => number_format((float)app('steam')->balance($account, $date), $decimalPlaces, '.', ''),
- 'current_balance_date' => $date->format('Y-m-d'),
+ 'current_balance_date' => $date->toAtomString(),
'notes' => $this->repository->getNoteText($account),
'monthly_payment_date' => $monthlyPaymentDate,
'credit_card_type' => $creditCardType,
@@ -195,6 +195,9 @@ class AccountTransformer extends AbstractTransformer
$creditCardType = $this->repository->getMetaValue($account, 'cc_type');
$monthlyPaymentDate = $this->repository->getMetaValue($account, 'cc_monthly_payment_date');
}
+ if(null !== $monthlyPaymentDate) {
+ $monthlyPaymentDate = Carbon::createFromFormat('!Y-m-d', $monthlyPaymentDate, config('app.timezone'))->toAtomString();
+ }
return [$creditCardType, $monthlyPaymentDate];
}
@@ -218,6 +221,9 @@ class AccountTransformer extends AbstractTransformer
$openingBalance = $amount;
$openingBalanceDate = $this->repository->getOpeningBalanceDate($account);
}
+ if(null !== $openingBalanceDate) {
+ $openingBalanceDate = Carbon::createFromFormat('!Y-m-d', $openingBalanceDate, config('app.timezone'))->toAtomString();
+ }
return [$openingBalance, $openingBalanceDate];
}