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