We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38bccf6 commit 68af710Copy full SHA for 68af710
1 file changed
src/Tags/Events.php
@@ -5,6 +5,7 @@
5
use Carbon\Carbon;
6
use Carbon\CarbonImmutable;
7
use Carbon\CarbonInterface;
8
+use Carbon\CarbonPeriod;
9
use Illuminate\Pagination\Paginator;
10
use Illuminate\Support\Collection;
11
use Statamic\Contracts\Query\Builder;
@@ -47,6 +48,16 @@ public function calendar(): Collection
47
48
return $this->output($this->makeEmptyDates(from: $from, to: $to)->merge($occurrences)->values());
49
}
50
51
+ public function daysOfWeek(): Collection
52
+ {
53
+ return collect(CarbonPeriod::dates(now()->startOfWeek(), now()->endOfWeek()))
54
+ ->map(fn (Carbon $date) => [
55
+ 'short' => $date->format('D')[0],
56
+ 'medium' => $date->format('D'),
57
+ 'long' => $date->format('l'),
58
+ ]);
59
+ }
60
+
61
public function downloadLink(): string
62
{
63
return route(
0 commit comments