• PropertyGroupValues and type=date

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #30431  by Catscratch
 
Hi there,

I got a strange bug when using dates in PropertyGroups. But first, what did I do?

Assume the following PropertyGroup.xml.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.2//EN" "http://www.openkm.com/dtd/property-groups-2.2.dtd">
<property-groups>
  <property-group label="DEMO" name="demoid">
   <input label="My awesome Date" type="date" name="dateid" />
  </property-group>
</property-groups>
Now, I set the PropertyValues via OpenKM SDK to:
Code: Select all
dateid=18-06-2007
So, everthing is fine here. Then I log into OpenKM and open the property group in the frontend.
There the date is presented as:
Code: Select all
My awesome Date: 03-12-0017
So I debugged the OKMPropertyGroup.java : getProperties.
In the Debugger the ret variable is right. So the date is still 18-06-2007 inside.

In the PropertyGroupServlet.java : getProperties the GWTFormElement is also correct.

So my question is, why is the date wrong in the browser, but right in the backend. Did you do some kind of convertion via JavaScript or some other magic when leaving the backend code?

Thanks for hints.

Edit: I found something. In PropertyGroupServlet:java - line 210 you copy the FormElement to a GWTFormElement.

The FormElement looks like this:
Code: Select all
{label=My awesome Date, name=dateid, value=18-06-2007, data=, width=100px, height=25px, readonly=false, type=date, validators=[]}
The GWTFormElement like this:
Code: Select all
{label=My awesome Date, name=dateid, value=18-06-2007, width=100px, height=25px, readonly=false, type=date, validators=[], date=Sun Dec 05 22:00:07 CET 17, data=}
So, where does date=Sun Dec 05 22:00:07 CET 17 come from?

Edit2: I found it. Seems like you changed the date format in some of the last updates. In the past it was 'dd-MM-yyyy' now it is 'yyyyMMddHHmmss'. I changed my API call to the new format and now it is working.

CLOSE
 #30471  by jllort
 
Sorry but it's something not well explained in documentation. As you discovered the input fields with type date save information with pattern "yyyyMMddHHmmss", this is an aproximation to ISO8601 except for what we've decided to do not store the TZD ( the timezone, now I do not want to extend the explanation why we've done this decision ).

I've updated this wiki section http://wiki.openkm.com/index.php/Form_E ... tion#Input .Actually we're involved on doing entire documentation in new format etc... Apology for the actual documentation, during this time we've learnt a lot about what we want and what not. Our plan is got new documentation at April of 2015, I know, it's a long time.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.