You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ta...@apache.org on 2016/10/28 14:11:52 UTC

svn commit: r1767026 - in /poi: site/src/documentation/content/xdocs/status.xml trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java

Author: tallison
Date: Fri Oct 28 14:11:52 2016
New Revision: 1767026

URL: http://svn.apache.org/viewvc?rev=1767026&view=rev
Log:
60315 -- allow 'yyyy-MM-dd' as a valid date format in metadata in OPCParser

Modified:
    poi/site/src/documentation/content/xdocs/status.xml
    poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java
    poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java

Modified: poi/site/src/documentation/content/xdocs/status.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/status.xml?rev=1767026&r1=1767025&r2=1767026&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/status.xml (original)
+++ poi/site/src/documentation/content/xdocs/status.xml Fri Oct 28 14:11:52 2016
@@ -60,6 +60,7 @@
         <summary-item>Document each major change in the release notes in a summary item</summary-item>
       </summary -->
       <actions>
+        <action dev="PD" type="fix" fixes-bug="60315" module="OPC">Add 'yyyy-MM-dd' as a possible format for date metadata items in OPC</action>
         <action dev="PD" type="fix" fixes-bug="60305" module="HSLF">Gracefully handle AIOOBE in reading potentially truncated pictstream</action>
       	<action dev="PD" type="remove" fixes-bug="60059" module="XSLF">Deprecate xslf.usermodel.Drawing* - was: Can't change text of DrawingParagraph</action>
         <action dev="PD" type="add" module="HDGF">Partial v5 Pointer and Text Extraction support</action>

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java?rev=1767026&r1=1767025&r2=1767026&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java Fri Oct 28 14:11:52 2016
@@ -55,6 +55,7 @@ public final class PackagePropertiesPart
 	private final static String[] DATE_FORMATS = new String[]{
 			DEFAULT_DATEFORMAT,
 			"yyyy-MM-dd'T'HH:mm:ss.SS'Z'",
+            "yyyy-MM-dd"
 	};
 
 	//Had to add this and TIME_ZONE_PAT to handle tz with colons.
@@ -635,7 +636,7 @@ public final class PackagePropertiesPart
 		if (date == null) {
 		   return "";
 		}
-		
+
 		SimpleDateFormat df = new SimpleDateFormat(DEFAULT_DATEFORMAT, Locale.ROOT);
 		df.setTimeZone(LocaleUtil.TIMEZONE_UTC);
 		return df.format(date);

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java?rev=1767026&r1=1767025&r2=1767026&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackageCoreProperties.java Fri Oct 28 14:11:52 2016
@@ -94,6 +94,9 @@ public final class TestPackageCoreProper
         props.setCreatedProperty("2007-05-12T06:00:00-0200");
         assertEquals(dateToInsert, props.getCreatedProperty().getValue());
 
+        props.setCreatedProperty("2015-07-27");
+        assertEquals(msdf.parse("2015-07-27T00:00:00.000Z"), props.getCreatedProperty().getValue());
+
         props.setCreatedProperty("2007-05-12T10:00:00.123+0200");
         assertEquals(msdf.parse("2007-05-12T08:00:00.123Z"), props.getCreatedProperty().getValue());
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org