Tag and recurrence as date-time string

This commit is contained in:
James Cole
2021-04-02 06:18:04 +02:00
parent b893651223
commit a2ae977550
2 changed files with 5 additions and 5 deletions

View File

@@ -89,9 +89,9 @@ class RecurrenceTransformer extends AbstractTransformer
'type' => $shortType, 'type' => $shortType,
'title' => $recurrence->title, 'title' => $recurrence->title,
'description' => $recurrence->description, 'description' => $recurrence->description,
'first_date' => $recurrence->first_date->format('Y-m-d'), 'first_date' => $recurrence->first_date->toAtomString(),
'latest_date' => null === $recurrence->latest_date ? null : $recurrence->latest_date->format('Y-m-d'), 'latest_date' => null === $recurrence->latest_date ? null : $recurrence->latest_date->toAtomString(),
'repeat_until' => null === $recurrence->repeat_until ? null : $recurrence->repeat_until->format('Y-m-d'), 'repeat_until' => null === $recurrence->repeat_until ? null : $recurrence->repeat_until->toAtomString(),
'apply_rules' => $recurrence->apply_rules, 'apply_rules' => $recurrence->apply_rules,
'active' => $recurrence->active, 'active' => $recurrence->active,
'nr_of_repetitions' => $reps, 'nr_of_repetitions' => $reps,
@@ -137,7 +137,7 @@ class RecurrenceTransformer extends AbstractTransformer
$occurrences = $this->repository->getXOccurrencesSince($repetition, $fromDate, new Carbon, 5); $occurrences = $this->repository->getXOccurrencesSince($repetition, $fromDate, new Carbon, 5);
/** @var Carbon $carbon */ /** @var Carbon $carbon */
foreach ($occurrences as $carbon) { foreach ($occurrences as $carbon) {
$repetitionArray['occurrences'][] = $carbon->format('Y-m-d'); $repetitionArray['occurrences'][] = $carbon->toAtomString();
} }
$return[] = $repetitionArray; $return[] = $repetitionArray;

View File

@@ -42,7 +42,7 @@ class TagTransformer extends AbstractTransformer
*/ */
public function transform(Tag $tag): array 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 */ /** @var Location $location */
$location = $tag->locations()->first(); $location = $tag->locations()->first();
$latitude = null; $latitude = null;