diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 3e37911e8..caa238df5 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,7 @@ + 45398 - Support detecting date formats containing "am/pm" as date times 45410 - Removed dependency from contrib on commons beanutils,collections and lang New helper, HSSFOptimiser, which handles removing duplicated font and style records, to avoid going over the limits in Excel 45322 - Fixed NPE in HSSFSheet.autoSizeColumn() when cell number format was not found diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 511b570a2..798d35829 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 45398 - Support detecting date formats containing "am/pm" as date times 45410 - Removed dependency from contrib on commons beanutils,collections and lang New helper, HSSFOptimiser, which handles removing duplicated font and style records, to avoid going over the limits in Excel 45322 - Fixed NPE in HSSFSheet.autoSizeColumn() when cell number format was not found diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFDateUtil.java b/src/java/org/apache/poi/hssf/usermodel/HSSFDateUtil.java index be590c3a2..ab353ca02 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFDateUtil.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFDateUtil.java @@ -231,7 +231,7 @@ public class HSSFDateUtil // Otherwise, check it's only made up, in any case, of: // y m d h s - / , . : // optionally followed by AM/PM - if(fs.matches("^[yYmMdDhHsS\\-/,. :]+[ampAMP]*$")) { + if(fs.matches("^[yYmMdDhHsS\\-/,. :]+[ampAMP/]*$")) { return true; } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java index 2ac4eb825..894c77d68 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java @@ -273,7 +273,8 @@ public class TestHSSFDateUtil extends TestCase { "yyyy-mm-dd hh:mm:ss", "yyyy/mm/dd HH:MM:SS", "mm/dd HH:MM", "yy/mmm/dd SS", "mm/dd HH:MM AM", "mm/dd HH:MM am", - "mm/dd HH:MM PM", "mm/dd HH:MM pm" + "mm/dd HH:MM PM", "mm/dd HH:MM pm", + "m/d/yy h:mm AM/PM" }; for(int i=0; i