aschott-looker opened a new pull request #234:
URL: https://github.com/apache/poi/pull/234


   * This PR addresses two bugs described below. Consider the following format: 
`"d \d\a\y\s h"`.
   * For one, The logic in 
`org.apache.poi.ss.format.CellDateFormatter.DatePartHandler#finish` uses the 
position of the "h" to upcase unless AM/PM formatting was requested in the 
string. The example format will blow up with an index out of bounds exception 
because the `\d\a\y\s` section is replaced with `'days'` which changes the 
length of the string. My fix was to update the position whenever we update the 
length of the string so that we don't go out of bounds of the string.
   * Secondly, there was a previous fix that regex'd the "y" out of the string 
and replaced it with "yy". This does not work since it does not account for 
"y"'s in an escaped text block like in my example so you would get an output of 
`dayys`. It is better to do this type of thing in the part handler while we are 
parsing/tokenizing the string.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to