Updated to laravel 11

This commit is contained in:
Constantin Graf
2024-03-27 15:00:00 +01:00
parent 5d256650d2
commit ebd4754773
22 changed files with 1585 additions and 847 deletions

View File

@@ -93,12 +93,12 @@ class TogglTimeEntriesImporter extends DefaultImporter
$timeEntry->billable = $record['Billable'] === 'Yes';
$timeEntry->tags = $this->getTags($record['Tags']);
$start = Carbon::createFromFormat('Y-m-d H:i:s', $record['Start date'].' '.$record['Start time'], 'UTC');
if ($start === false) {
if ($start === null) {
throw new ImportException('Start date ("'.$record['Start date'].'") or time ("'.$record['Start time'].'") are invalid');
}
$timeEntry->start = $start;
$end = Carbon::createFromFormat('Y-m-d H:i:s', $record['End date'].' '.$record['End time'], 'UTC');
if ($end === false) {
if ($end === null) {
throw new ImportException('End date ("'.$record['End date'].'") or time ("'.$record['End time'].'") are invalid');
}
$timeEntry->end = $end;