Hi Skrol
I want propose make saome fix in code of OpenTBS plugin.
It is related to tbs:date operation in block :
case 'tbs:date':
case 'tbs:time':
case 'xlsxDate':
if (is_string($Value)) {
$t = strtotime($Value); // We look if it's a date
} else {
$t = $Value;
}
if (($t===-1) or ($t===false)) { // Date not recognized
$Value = '';
} elseif ($t===943916400) { // Date to zero
$Value = '';
} else { // It's a date
$Value = ($t/86400.00)+25569; // unix: 1 means 01/01/1970, xls: 1 means 01/01/1900
}
break;
|
Propose is to add here
if (($t===-1) or ($t===false)) { // Date not recognized
|
check for null :
if (($t===-1) or ($t===false) or ($t===null)) { // Date not recognized
|
For example, when data source is DB, and Date field has value = Null in DB, we will have date 1970-01-01 instead of empty cell in XLSX after merging.