Skip to content

Firefly III: a personal finances manager

Tag and recurrence as date-time string

James Colea2ae9775508c
diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php
index 1cc028e077..ae69d7de8b 100644
--- a/app/Transformers/RecurrenceTransformer.php
+++ b/app/Transformers/RecurrenceTransformer.php
@@ -89,9 +89,9 @@ class RecurrenceTransformer extends AbstractTransformer
'type' => $shortType,
'title' => $recurrence->title,
'description' => $recurrence->description,
- 'first_date' => $recurrence->first_date->format('Y-m-d'),
- 'latest_date' => null === $recurrence->latest_date ? null : $recurrence->latest_date->format('Y-m-d'),
- 'repeat_until' => null === $recurrence->repeat_until ? null : $recurrence->repeat_until->format('Y-m-d'),
+ 'first_date' => $recurrence->first_date->toAtomString(),
+ 'latest_date' => null === $recurrence->latest_date ? null : $recurrence->latest_date->toAtomString(),
+ 'repeat_until' => null === $recurrence->repeat_until ? null : $recurrence->repeat_until->toAtomString(),
'apply_rules' => $recurrence->apply_rules,
'active' => $recurrence->active,
'nr_of_repetitions' => $reps,
@@ -137,7 +137,7 @@ class RecurrenceTransformer extends AbstractTransformer
$occurrences = $this->repository->getXOccurrencesSince($repetition, $fromDate, new Carbon, 5);
/** @var Carbon $carbon */
foreach ($occurrences as $carbon) {
- $repetitionArray['occurrences'][] = $carbon->format('Y-m-d');
+ $repetitionArray['occurrences'][] = $carbon->toAtomString();
}
$return[] = $repetitionArray;
diff --git a/app/Transformers/TagTransformer.php b/app/Transformers/TagTransformer.php
index ed2fd634f0..d1119ff650 100644
--- a/app/Transformers/TagTransformer.php
+++ b/app/Transformers/TagTransformer.php
@@ -42,7 +42,7 @@ class TagTransformer extends AbstractTransformer
*/
public function transform(Tag $tag): array
{
- $date = null === $tag->date ? null : $tag->date->format('Y-m-d');
+ $date = null === $tag->date ? null : $tag->date->toAtomString();
/** @var Location $location */
$location = $tag->locations()->first();
$latitude = null;