Skip to content

Commit 191f247

Browse files
committed
Feat: insertDate and read data type
1 parent c90da75 commit 191f247

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel/excel.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,8 @@ PHP_METHOD(vtiful_xls, insertDate)
462462
SHEET_LINE_SET(obj, row);
463463

464464
if (Z_TYPE_P(data) != IS_LONG) {
465-
// throw
465+
zend_throw_exception(vtiful_exception_ce, "timestamp is long", 160);
466+
return;
466467
}
467468

468469
// Default datetime format
@@ -471,7 +472,7 @@ PHP_METHOD(vtiful_xls, insertDate)
471472
}
472473

473474
zval _zv_double_time;
474-
ZVAL_DOUBLE(&_zv_double_time, ((double)data->value.lval / 86400 + 25569))
475+
ZVAL_DOUBLE(&_zv_double_time, ((double)data->value.lval / 86400 + 25569));
475476

476477
if (format_handle) {
477478
type_writer(&_zv_double_time, row, column, &obj->write_ptr, format, zval_get_format(format_handle));

0 commit comments

Comments
 (0)