Turn dates into date-times.

This commit is contained in:
James Cole 2021-04-01 21:06:40 +02:00
parent e221d37d2b
commit b893651223
3 changed files with 6 additions and 6 deletions

View File

@ -70,8 +70,8 @@ class AvailableBudgetTransformer extends AbstractTransformer
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => (int)$currency->decimal_places,
'amount' => number_format((float)$availableBudget->amount, $currency->decimal_places, '.', ''),
'start' => $availableBudget->start_date->format('Y-m-d'),
'end' => $availableBudget->end_date->format('Y-m-d'),
'start' => $availableBudget->start_date->toAtomString(),
'end' => $availableBudget->end_date->endOfDay()->toAtomString(),
'spent_in_budgets' => [],
'spent_no_budget' => [],
'links' => [

View File

@ -86,8 +86,8 @@ class BudgetLimitTransformer extends AbstractTransformer
'id' => (string)$budgetLimit->id,
'created_at' => $budgetLimit->created_at->toAtomString(),
'updated_at' => $budgetLimit->updated_at->toAtomString(),
'start' => $budgetLimit->start_date->format('Y-m-d'),
'end' => $budgetLimit->end_date->format('Y-m-d'),
'start' => $budgetLimit->start_date->toAtomString(),
'end' => $budgetLimit->end_date->endOfDay()->toAtomString(),
'budget_id' => (string)$budgetLimit->budget_id,
'currency_id' => (string)$currencyId,
'currency_code' => $currencyCode,

View File

@ -90,8 +90,8 @@ class PiggyBankTransformer extends AbstractTransformer
// left to save:
$leftToSave = bcsub($piggyBank->targetamount, $currentAmountStr);
$startDate = null === $piggyBank->startdate ? null : $piggyBank->startdate->format('Y-m-d');
$targetDate = null === $piggyBank->targetdate ? null : $piggyBank->targetdate->format('Y-m-d');
$startDate = null === $piggyBank->startdate ? null : $piggyBank->startdate->toAtomString();
$targetDate = null === $piggyBank->targetdate ? null : $piggyBank->targetdate->toAtomString();
// target and percentage:
$targetAmount = $piggyBank->targetamount;