]> source.dussan.org Git - poi.git/commitdiff
Patch from Steve Vysny from bug #52438 - Update CellDateFormatter to handle times...
authorNick Burch <nick@apache.org>
Mon, 9 Jan 2012 18:21:54 +0000 (18:21 +0000)
committerNick Burch <nick@apache.org>
Mon, 9 Jan 2012 18:21:54 +0000 (18:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1229281 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/status.xml
src/java/org/apache/poi/ss/format/CellDateFormatter.java
test-data/spreadsheet/DateFormatTests.xlsx

index 5c420b3582dbc87a9b6969629d2d8908b43b506b..45adb130d601e005fb5c165c8193f6bb0eb1b3c6 100644 (file)
@@ -34,6 +34,7 @@
 
     <changes>
         <release version="3.8-beta6" date="2012-??-??">
+           <action dev="poi-developers" type="fix">52438 - Update CellDateFormatter to handle times without seconds</action>
            <action dev="poi-developers" type="add">52389 - Support ?/? as well as #/# fractions, and tighten DataFormatter rules for fraction matching</action>
            <action dev="poi-developers" type="add">52200 - Updated XWPF table example code </action>
            <action dev="poi-developers" type="add">52378 - Support for WORKDAY and NETWORKDAYS functions</action>
index 5007305e212076b4c2a0f26ea062ae1823b6fc8b..33a9118b159c9499dcf13bd2b65e636258afbe59 100644 (file)
@@ -90,7 +90,11 @@ public class CellDateFormatter extends CellFormatter {
             case 'M':
                 mStart = pos;
                 mLen = part.length();
-                return part.toUpperCase();
+                // For 'm' after 'h', output minutes ('m') not month ('M')
+                if (hStart >= 0)
+                    return part.toLowerCase();
+                else
+                    return part.toUpperCase();
 
             case 'y':
             case 'Y':
index a6099be4dad55ee195ce73b18882cca4a197925d..c6048309b8ad44e0dc33a478e025ee9212d07a97 100644 (file)
Binary files a/test-data/spreadsheet/DateFormatTests.xlsx and b/test-data/spreadsheet/DateFormatTests.xlsx differ