Bug 45398

Summary: [PATCH] Fix HSSFDateUtil to recognize formats with "AM/PM"
Product: POI Reporter: James <james.may>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: patch for org.apache.poi.hssf.usermodel.HSSFDateUtil.java

Description James 2008-07-15 08:48:43 UTC
Created attachment 22258 [details]
patch for org.apache.poi.hssf.usermodel.HSSFDateUtil.java

HSSFDateUtil.isADateFormat(int,String) returns a false negative when evaluating valid date formats containing "AM/PM", "am/pm", "A/P", "a/p". An example is "m/d/yy h:mm AM/PM".

This can be fixed by adding a forward slash to a regex character class in HSSFDateUtil.java. Patch attached.
Comment 1 Nick Burch 2008-07-18 10:16:56 UTC
Thanks, applied to svn, along with a unit test