diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 5c420b3582..45adb130d6 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 52438 - Update CellDateFormatter to handle times without seconds 52389 - Support ?/? as well as #/# fractions, and tighten DataFormatter rules for fraction matching 52200 - Updated XWPF table example code 52378 - Support for WORKDAY and NETWORKDAYS functions diff --git a/src/java/org/apache/poi/ss/format/CellDateFormatter.java b/src/java/org/apache/poi/ss/format/CellDateFormatter.java index 5007305e21..33a9118b15 100644 --- a/src/java/org/apache/poi/ss/format/CellDateFormatter.java +++ b/src/java/org/apache/poi/ss/format/CellDateFormatter.java @@ -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': diff --git a/test-data/spreadsheet/DateFormatTests.xlsx b/test-data/spreadsheet/DateFormatTests.xlsx index a6099be4da..c6048309b8 100644 Binary files a/test-data/spreadsheet/DateFormatTests.xlsx and b/test-data/spreadsheet/DateFormatTests.xlsx differ