You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and $eachCell->getFormattedValue() returns:
2021-02-15 20:02:00
2021-02-14 23:02:00
2021-02-15 03:02:00
My the dirty fix
namespacePhpOffice\PhpSpreadsheet\Style;
classNumberFormatextendsSupervisor
public functiongetFormatCode() {
return str_replace(':"mm"', ':"i"', $this->getOriginalFormatCode());
}
publicfunctiongetOriginalFormatCode() // rename original method
{
if ($this->isSupervisor) {
return$this->getSharedComponent()->getFormatCode();
}
if ($this->builtInFormatCode !== false) {
returnself::builtInFormatCode($this->builtInFormatCode);
}
return$this->formatCode;
}
My another fix didnt help:
classNumberFormatextendsSupervisor
private static$dateFormatReplacements = [
'mmm' => 'M',
// mm is minutes if time, but can also be month w/leading zero// so we try to identify times be the inclusion of a : separator in the mask// It isn't perfect, but the best way I know how':mm' => ':i',
'mm:' => 'i:',
':"mm"' => ':"i"', // skynin'"mm":' => '"i":', // skynin
Which versions of PhpSpreadsheet and PHP are affected?
"version": "1.16.1"
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.
This is:
What is the expected behavior?
I have a google table with column:
2021-02-15 20:30:00
2021-02-14 23:00:00
2021-02-15 03:45:00
$eachCell->getStyle()->getNumberFormat()->getFormatCode() returns:
'yyyy"-"mm"-"dd" "hh":"mm":"ss',
and $eachCell->getFormattedValue() returns:
2021-02-15 20:02:00
2021-02-14 23:02:00
2021-02-15 03:02:00
My the dirty fix
My another fix didnt help:
Which versions of PhpSpreadsheet and PHP are affected?
"version": "1.16.1"
The text was updated successfully, but these errors were encountered: