summaryrefslogtreecommitdiffstats
path: root/poi-scratchpad
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2021-11-27 23:07:15 +0000
committerAndreas Beeker <kiwiwings@apache.org>2021-11-27 23:07:15 +0000
commitd9b0e2ebfad355b9c805411bafed7697433a98a6 (patch)
tree7c511790ddfe2595ed0c8c7de1a5d33cdd02e653 /poi-scratchpad
parent7475b1f6096eb9970661fef9927e66fb42667ffa (diff)
downloadpoi-d9b0e2ebfad355b9c805411bafed7697433a98a6.tar.gz
poi-d9b0e2ebfad355b9c805411bafed7697433a98a6.zip
Fix date format differences Java 8 vs 9+
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895383 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad')
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java
index cad2d0541a..eb156e0177 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/util/LocaleDateFormat.java
@@ -281,7 +281,7 @@ public final class LocaleDateFormat {
/**
* 10 - MMM-yy
*/
- ABBREVIATED_MONTH_AND_YEAR("LLL-yy", null, null),
+ ABBREVIATED_MONTH_AND_YEAR(isOldFmt () ? "MMM-yy" : "LLL-yy", null, null),
/**
* 11 - Base short date followed by a space, followed by base time with seconds removed.
* Seconds are removed by removing all "s" symbols and any symbol that directly precedes an
@@ -361,4 +361,8 @@ public final class LocaleDateFormat {
return MapFormatBase.mapFormatId(loc, (Integer)mappedFormat);
}
}
+
+ private static boolean isOldFmt() {
+ return System.getProperty("java.version").startsWith("1.8");
+ }
}