1. Go to this page and download the library: Download phpinnacle/tempo library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
phpinnacle / tempo example snippets
use PHPinnacle\Tempo\Forms\CronExpression;
use PHPinnacle\Tempo\Forms\DatePicker;
use PHPinnacle\Tempo\Forms\DateRangePicker;
use PHPinnacle\Tempo\Forms\DateTimePicker;
use PHPinnacle\Tempo\Forms\Duration;
use PHPinnacle\Tempo\Forms\TimePicker;
DatePicker::make('published_on');
DateTimePicker::make('published_at');
DateRangePicker::make('period');
TimePicker::make('starts_at');
CronExpression::make('schedule')
->showDescription()
->showDayOfWeek(false)
->gridColumns(['month' => 4])
->defaultMode('expression')
->presets(['Late weekdays' => '0 23 ? * MON-FRI'])
->
use PHPinnacle\Tempo\Filters\DateRangeFilter;
use PHPinnacle\Tempo\Filters\DateTimeRangeFilter;
use PHPinnacle\Tempo\Filters\TimeRangeFilter;
DateRangeFilter::createdAt();
DateRangeFilter::updatedAt();
DateRangeFilter::make('published_at');
DateTimeRangeFilter::make('published_window')
->column('published_at');
TimeRangeFilter::make('starts_window')
->column('starts_at');
use PHPinnacle\Tempo\Clock;
Clock::now();
Clock::date();
Clock::unix();
Clock::year();
use PHPinnacle\Tempo\Contracts\EventSource;
use PHPinnacle\Tempo\Widgets\CalendarWidget;
final class AppointmentsCalendarWidget extends CalendarWidget
{
/** @return list<EventSource> */
public function getEventSources(): array
{
return [
new AppointmentsEventSource(),
new DeadlinesEventSource(),
];
}
}
use Filament\Support\Colors\Color;
use Filament\Support\Icons\Heroicon;
use PHPinnacle\Tempo\Calendar\CalendarEvent;
use PHPinnacle\Tempo\Calendar\CalendarRange;
use PHPinnacle\Tempo\Contracts\EventSource;
final class AppointmentsEventSource implements EventSource
{
public function getKey(): string
{
return 'appointments';
}
public function getLabel(): string
{
return 'Appointments';
}
public function getIcon(): Heroicon
{
return Heroicon::CalendarDays;
}
public function getColor(): array
{
return Color::Blue;
}
/** @return list<CalendarEvent> */
public function getEvents(CalendarRange $range, int $limit): array
{
return [];
}
}
AppointmentsCalendarWidget::make();
use Carbon\CarbonImmutable;
use PHPinnacle\Tempo\Calendar\CalendarRange;
use PHPinnacle\Tempo\Calendar\RecurrenceExpander;
use PHPinnacle\Tempo\Calendar\RecurringEvent;
$range = CalendarRange::create('2026-07-01', '2026-08-01')
?? throw new InvalidArgumentException('Invalid calendar range.');
$occurrences = app(RecurrenceExpander::class)->expand(
new RecurringEvent(
rule: 'FREQ=YEARLY',
start: CarbonImmutable::parse('1990-07-15'),
),
$range,
limit: 100,
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.