2

So I'm trying to use dates with mysql on the wso2 dss. Simple code

<query id="testDates" useConfig="PORTFOLIOS_DS">
<sql>
  SELECT DATE(date) AS date FROM dateTest
</sql>
<result element="jsonObject" rowName="jsonArray">
  <element column="date" name="testDate" xsdType="date"/>
</result>
</query>

So it returns "2015-03-10-04:00" which isn't considered a valid date my many libraries (momentJS in particular) and to be fair it is a strange format, why do I care about timezone without the time.

Does anyone know why it is appending the timezone, how can I prevent the appending of timezone to dates but leave it on datetimes?

Jegsar
  • 501
  • 6
  • 22
  • Had you solve this problem? I face same issue here. – irvana Jun 23 '15 at 14:49
  • I haven't properly. Short term we split the date apart on the ui with java script. Long term we are replacing the dss with a nodejs most likely. – Jegsar Jun 23 '15 at 15:17

1 Answers1

0

I was able to reproduce this issue with DSS 3.5.0 version. So I have already created a public JIRA ticket [1]. and once this is fixed I will notify you.

In the meantime as a workaround, I would like to suggest to use an XSLT transformation to trip off timezone information. For more information about how to use XSLT inside the DSS server please refer [2]

[1]. https://wso2.org/jira/browse/DS-1191

[2]. https://docs.wso2.com/display/DSS350/XSLT+Transformation+Sample

Upul Bandara
  • 5,973
  • 4
  • 37
  • 60