Closed nsoloviev closed 3 years ago
master
'autoXlFormat' => true,
'created_at' => [ 'attribute' => 'created_at', 'value' => function ($model) { return date('d.m.Y H:i:s', strtotime($model->created_at)); }, 'format' => 'datetime', ],
<td class="w0" data-col-seq="created_at" data-raw-value="2021-01-08 16:13:24" style="mso-number-format: yyyy\-MM\-dd HH\:mm\:ss;">08.01.2021, 16:13:24</td>
When I follow those steps, In the Excel file, the format remains the same as in the grid
I was expecting excel format
I debugged a little and realized that this condition is always false:
if ($td.css('mso-number-format') || $td.css('mso-number-format') === 0 || $td.css('mso-number-format') === '0') { $td.html($td.attr('data-raw-value')).removeAttr('data-raw-value'); }
https://github.com/kartik-v/yii2-grid/blob/master/src/assets/js/kv-grid-export.js#L376
Because $td.css('mso-number-format') is always undefined, I think because this is an unknown property
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Prerequisites
master
branch of yii2-grid.Steps to reproduce the issue
'autoXlFormat' => true,
<td class="w0" data-col-seq="created_at" data-raw-value="2021-01-08 16:13:24" style="mso-number-format: yyyy\-MM\-dd HH\:mm\:ss;">08.01.2021, 16:13:24</td>
Expected behavior and actual behavior
When I follow those steps, In the Excel file, the format remains the same as in the grid
I was expecting excel format
I debugged a little and realized that this condition is always false:
https://github.com/kartik-v/yii2-grid/blob/master/src/assets/js/kv-grid-export.js#L376
Because $td.css('mso-number-format') is always undefined, I think because this is an unknown property
Browsers
Operating System
Libraries
Isolating the problem