jasonrogena / jasonrogena/php-excel-reader
Times formatted as "[h]:mm:ss" return ":mm:ss".
- Dominant language
- PHP
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
```
What steps will reproduce the problem?
1. Enter a time.
2. Format it as [h]:mm:ss.
3. Read it into php. Returns as :mm:ss. Query for format returns: ":i:s".
What is the expected output? What do you see instead?
Expect either hh:mm:ss if h!=0 or mm:ss or 0:mm:ss if h=0, not ":mm:ss".
Please provide any additional information below.
At line 1224 this project has added: $tmp =
preg_replace("/^\[[^\]]*\]/","",$tmp);. Suggest: $tmp =
preg_replace("/^\[([^\]]*)\]/","$1",$tmp);. I'm not sure why you would discard
the values inside the [], it results in improper excel date formats. In limited
tests I ran this change solved the problem. Please advise if you think I'm
overlooking something, I'm certainly no expert on excel.
This is a massively useful project btw, thanks.
```
Original issue reported on code.google.com by `snevetse...@gmail.com` on 22 Jan 2013 at 5:02
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at line 1224 and inspect how bracketed time components are handled by the format parser. Reproduce the issue with [h]:mm:ss and compare the returned value and queried format with the expected hour, minute, and second components. Done means the bracketed hour is preserved without breaking existing Excel date formats.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100