Skip to content

Commit b03815e

Browse files
committed
Rename function readDateTime
1 parent 6b7a783 commit b03815e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/XlsxFastEditor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ public function readFloat(int $sheetNumber, string $cellName): ?float
599599
* @param int $sheetNumber Worksheet number (base 1)
600600
* @param $cellName Cell name such as `B4`
601601
*/
602-
public function readDate(int $sheetNumber, string $cellName): ?\DateTimeImmutable
602+
public function readDateTime(int $sheetNumber, string $cellName): ?\DateTimeImmutable
603603
{
604604
$cell = $this->getCell($sheetNumber, $cellName, XlsxFastEditor::ACCESS_MODE_NULL);
605605
return $cell === null ? null : $cell->readDateTime();

tests/test.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
assert($xlsxFastEditor->readInt($sheet2, 'c3') === -5 * 2);
4949
assert($xlsxFastEditor->readString($sheet2, 'B3') === 'déjà-vu');
5050

51-
assert($xlsxFastEditor->readDate($sheet1, 'F2')?->format('c') === '1980-11-24T00:00:00+00:00');
52-
assert($xlsxFastEditor->readDate($sheet1, 'F3')?->format('c') === '1980-11-24T10:20:30+00:00');
53-
assert($xlsxFastEditor->readDate($sheet1, 'F4')?->format('c') === '1900-01-01T10:20:30+00:00');
51+
assert($xlsxFastEditor->readDateTime($sheet1, 'F2')?->format('c') === '1980-11-24T00:00:00+00:00');
52+
assert($xlsxFastEditor->readDateTime($sheet1, 'F3')?->format('c') === '1980-11-24T10:20:30+00:00');
53+
assert($xlsxFastEditor->readDateTime($sheet1, 'F4')?->format('c') === '1900-01-01T10:20:30+00:00');
5454

5555
assert($xlsxFastEditor->readArray($sheet1)['B'][2] === 'Hello');
5656
assert($xlsxFastEditor->readArrayWithHeaders($sheet1)['Strings'][2] === 'Hello');

0 commit comments

Comments
 (0)