-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix time format #666
Fix time format #666
Conversation
…should convert to the "total hours:minutes"
Nice work @GreatHumorist I think this will also fix @ivankruchkoff's issue #446 and @garrettgjb's issue #342 as the time format is no longer being stripped by the color |
@patrickomeara this is because the color strip code make [h] be stripped, and the time format default replace h as G in date format, which G represent the 24h format in a day, but which you want is the total hours, in excel, the [h] will default convert it to the total hours, but the PhpSpreadsheet have not achieved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the test data I see quite a few missing cases. Most notably for colors, and also for elapsed periods as mentioned here: https://support.office.com/en-us/article/format-numbers-as-dates-or-times-418bd3fe-0577-47c8-8caa-b4d30c528309.
Would you mind adding those ?
I can add some test cases. @GreatHumorist are you able to resolve the conflicts via rebase or merge first? |
@patrickomeara feel free to open a new PR based on this one if @GreatHumorist does not reply |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I ended up adding a few cases myself and merged. Thanks ! |
When using format `[h]:mm` it should convert to the "total hours:minutes" Closes PHPOffice#666 Fixes PHPOffice#664 Fixes PHPOffice#446 Fixes PHPOffice#342
This is:
Checklist:
Why this change is needed?
relate issue #664
fix time format for duration is incorrect, when use format [h]:mm it should convert to the "total hours:minutes"