Skip to content

Commit

Permalink
Keep original behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
vidy committed Aug 27, 2024
1 parent ff33747 commit a7280e1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions kernel/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,13 @@ void chart_writer(zend_long row, zend_long columns, xls_resource_chart_t *chart_
*/
void datetime_writer(lxw_datetime *datetime, zend_long row, zend_long columns, zend_string *format, xls_resource_write_t *res, lxw_format *format_handle)
{
if (format_handle != NULL) {
format_set_num_format(format_handle, ZSTR_VAL(format));
lxw_format *value_format = format_handle;
if (format_handle == NULL) {
value_format = workbook_add_format(res->workbook);
}

worksheet_write_datetime(res->worksheet, (lxw_row_t)row, (lxw_col_t)columns, datetime, format_handle);

format_set_num_format(value_format, ZSTR_VAL(format));
worksheet_write_datetime(res->worksheet, (lxw_row_t)row, (lxw_col_t)columns, datetime, value_format);
}

/*
Expand Down Expand Up @@ -347,6 +349,7 @@ void set_row(zend_string *range, double height, xls_resource_write_t *res, lxw_f
void validation(xls_resource_write_t *res, zend_string *range, lxw_data_validation *validation)
{
char *rangeStr = ZSTR_VAL(range);

if (strchr(rangeStr, ':')) {
worksheet_data_validation_range(res->worksheet, RANGE(rangeStr), validation);
} else {
Expand Down

0 comments on commit a7280e1

Please sign in to comment.