mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 00:02:15 +01:00
Fixed timezone in time entries importer
This commit is contained in:
@@ -121,7 +121,7 @@ class ClockifyTimeEntriesImporter extends DefaultImporter
|
||||
if ($start === null) {
|
||||
throw new ImportException('Start date ("'.$record['Start Date'].'") or time ("'.$record['Start Time'].'") are invalid');
|
||||
}
|
||||
$timeEntry->start = $start;
|
||||
$timeEntry->start = $start->utc();
|
||||
|
||||
// End
|
||||
try {
|
||||
@@ -136,7 +136,7 @@ class ClockifyTimeEntriesImporter extends DefaultImporter
|
||||
if ($end === null) {
|
||||
throw new ImportException('End date ("'.$record['End Date'].'") or time ("'.$record['End Time'].'") are invalid');
|
||||
}
|
||||
$timeEntry->end = $end;
|
||||
$timeEntry->end = $end->utc();
|
||||
$timeEntry->setComputedAttributeValue('billable_rate');
|
||||
$timeEntry->save();
|
||||
$this->timeEntriesCreated++;
|
||||
|
||||
@@ -112,7 +112,7 @@ class TogglTimeEntriesImporter extends DefaultImporter
|
||||
if ($start === null) {
|
||||
throw new ImportException('Start date ("'.$record['Start date'].'") or time ("'.$record['Start time'].'") are invalid');
|
||||
}
|
||||
$timeEntry->start = $start;
|
||||
$timeEntry->start = $start->utc();
|
||||
|
||||
try {
|
||||
$end = Carbon::createFromFormat('Y-m-d H:i:s', $record['End date'].' '.$record['End time'], $timezone);
|
||||
@@ -122,7 +122,7 @@ class TogglTimeEntriesImporter extends DefaultImporter
|
||||
if ($end === null) {
|
||||
throw new ImportException('End date ("'.$record['End date'].'") or time ("'.$record['End time'].'") are invalid');
|
||||
}
|
||||
$timeEntry->end = $end;
|
||||
$timeEntry->end = $end->utc();
|
||||
$timeEntry->setComputedAttributeValue('billable_rate');
|
||||
$timeEntry->save();
|
||||
$this->timeEntriesCreated++;
|
||||
|
||||
Reference in New Issue
Block a user