]> source.dussan.org Git - poi.git/commitdiff
Patch from bug #45398 - Support detecting date formats containing "am/pm" as date...
authorNick Burch <nick@apache.org>
Fri, 18 Jul 2008 17:16:50 +0000 (17:16 +0000)
committerNick Burch <nick@apache.org>
Fri, 18 Jul 2008 17:16:50 +0000 (17:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@677974 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/changes.xml
src/documentation/content/xdocs/status.xml
src/java/org/apache/poi/hssf/usermodel/HSSFDateUtil.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFDateUtil.java

index 3e37911e843bd58527e644ed06549eb80d348357..caa238df5949453bc7f08c7c715aeacae76b3d61 100644 (file)
@@ -37,6 +37,7 @@
 
                <!-- Don't forget to update status.xml too! -->
         <release version="3.1.1-alpha1" date="2008-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">45398 - Support detecting date formats containing "am/pm" as date times</action>
            <action dev="POI-DEVELOPERS" type="fix">45410 - Removed dependency from contrib on commons beanutils,collections and lang</action>
            <action dev="POI-DEVELOPERS" type="add">New helper, HSSFOptimiser, which handles removing duplicated font and style records, to avoid going over the limits in Excel</action>
            <action dev="POI-DEVELOPERS" type="fix">45322 - Fixed NPE in HSSFSheet.autoSizeColumn() when cell number format was not found</action>
index 511b570a2dcb196bf5b5b9f6c4931f1e83dbca72..798d358294227505e2346f002a84a991c23c1307 100644 (file)
@@ -34,6 +34,7 @@
        <!-- Don't forget to update changes.xml too! -->
     <changes>
         <release version="3.1.1-alpha1" date="2008-??-??">
+           <action dev="POI-DEVELOPERS" type="fix">45398 - Support detecting date formats containing "am/pm" as date times</action>
            <action dev="POI-DEVELOPERS" type="fix">45410 - Removed dependency from contrib on commons beanutils,collections and lang</action>
            <action dev="POI-DEVELOPERS" type="add">New helper, HSSFOptimiser, which handles removing duplicated font and style records, to avoid going over the limits in Excel</action>
            <action dev="POI-DEVELOPERS" type="fix">45322 - Fixed NPE in HSSFSheet.autoSizeColumn() when cell number format was not found</action>
index be590c3a2d18eb2b13f31c994d9c5dc02d5137a2..ab353ca02c09b59200b1219a543fe3c5fccb1bc8 100644 (file)
@@ -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;
        }
        
index 2ac4eb825f9e7d06fe27d0ca1a7b5d58c5d52365..894c77d685d24e40d7a6f9f1c621edb2fd6bd1dc 100644 (file)
@@ -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<formats.length; i++) {
             assertTrue(