fixed issues reported by coding standards tool

This commit is contained in:
Oded Arbel 2020-10-30 23:27:57 +02:00
parent c9d4b60d5b
commit 16458d6bf3

View File

@ -207,10 +207,10 @@ class WorksheetManager implements WorksheetManagerInterface
} elseif ($cell->isDate()) { } elseif ($cell->isDate()) {
$value = $cell->getValue(); $value = $cell->getValue();
if ($value instanceof \DateTime) { if ($value instanceof \DateTime) {
$datevalue = substr($value->setTimezone(new \DateTimeZone("UTC"))->format(\DateTimeInterface::W3C),0,-6); $datevalue = substr($value->setTimezone(new \DateTimeZone('UTC'))->format(\DateTimeInterface::W3C), 0, -6);
$data .= ' office:value-type="date" calcext:value-type="date" office:date-value="' . $datevalue . 'Z">'; $data .= ' office:value-type="date" calcext:value-type="date" office:date-value="' . $datevalue . 'Z">';
$data .= '<text:p>' . $datevalue . 'Z</text:p>'; $data .= '<text:p>' . $datevalue . 'Z</text:p>';
} else if ($value instanceof \DateInterval) { } elseif ($value instanceof \DateInterval) {
// workaround for missing DateInterval::format('c'), see https://stackoverflow.com/a/61088115/53538 // workaround for missing DateInterval::format('c'), see https://stackoverflow.com/a/61088115/53538
static $f = ['M0S', 'H0M', 'DT0H', 'M0D', 'Y0M', 'P0Y', 'Y0M', 'P0M']; static $f = ['M0S', 'H0M', 'DT0H', 'M0D', 'Y0M', 'P0Y', 'Y0M', 'P0M'];
static $r = ['M', 'H', 'DT', 'M', 'Y0M', 'P', 'Y', 'P']; static $r = ['M', 'H', 'DT', 'M', 'Y0M', 'P', 'Y', 'P'];