Skip to content

Commit

Permalink
feat: moved time intervals to 15 mins
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Jun 21, 2024
1 parent ceb16cb commit 083d28a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions app/Livewire/BackupTasks/CreateBackupTaskForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public function mount(): void
$this->backupDestinationId = Auth::user()->backupDestinations->first()?->id ?? '';
}

// Initialize backup times in half-hour increments
$this->backupTimes = collect(range(0, 47))->map(function ($halfHour) {
$hour = intdiv($halfHour, 2);
$minute = ($halfHour % 2) * 30;
// Initialize backup times in 15min increments
$this->backupTimes = collect(range(0, 95))->map(function ($quarterHour) {
$hour = intdiv($quarterHour, 4);
$minute = ($quarterHour % 4) * 15;

return sprintf('%02d:%02d', $hour, $minute);
});
Expand Down
6 changes: 3 additions & 3 deletions app/Livewire/BackupTasks/UpdateBackupTaskForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ public function mount(): void
$this->availableTags = Auth::user()->tags;
$this->selectedTags = $this->backupTask->tags->pluck('id')->toArray();

$this->backupTimes = collect(range(0, 47))->map(function ($halfHour) {
$hour = intdiv($halfHour, 2);
$minute = ($halfHour % 2) * 30;
$this->backupTimes = collect(range(0, 95))->map(function ($quarterHour) {
$hour = intdiv($quarterHour, 4);
$minute = ($quarterHour % 4) * 15;

return sprintf('%02d:%02d', $hour, $minute);
});
Expand Down

0 comments on commit 083d28a

Please sign in to comment.