Bug 45398 - [PATCH] Fix HSSFDateUtil to recognize formats with "AM/PM"
[PATCH] Fix HSSFDateUtil to recognize formats with "AM/PM"
Status: RESOLVED FIXED
Product: POI
Classification: Unclassified
Component: HSSF
unspecified
All All
: P2 minor (vote)
: ---
Assigned To: POI Developers List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2008-07-15 08:48 UTC by James
Modified: 2008-07-18 10:16 UTC (History)
0 users



Attachments
patch for org.apache.poi.hssf.usermodel.HSSFDateUtil.java (763 bytes, patch)
2008-07-15 08:48 UTC, James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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