xtype datefield throws ValueFormatexception | Community
Skip to main content
New Participant
October 16, 2015
Solved

xtype datefield throws ValueFormatexception

Hello

 I'm trying to use the xtype datefield to my widget. After selecting the date and saving the dialog , I'm getting a "ValueFormatexception : Invalid date" warning alert and the data is not saved in the repository. 

 Below is the console exception.

org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.
javax.jcr.ValueFormatException: Invalid date 05/15/15
    at org.apache.jackrabbit.oak.plugins.value.ValueFactoryImpl.createValue(ValueFactoryImpl.java:229)
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl.setProperty(NodeImpl.java:437)
    at org.apache.sling.servlets.post.impl.helper.SlingPropertyValueHandler.store(SlingPropertyValueHandler.java:594)

 Any ideas on how to fix this please ?

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
October 16, 2015

what is the datefomat you have selected... I see the format of year is yy instead of yyyy and that might be the issue.

2 replies

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
Level 10
October 16, 2015

what is the datefomat you have selected... I see the format of year is yy instead of yyyy and that might be the issue.

Translate
New Participant
October 16, 2015

bsloki wrote...

what is the datefomat you have selected... I see the format of year is yy instead of yyyy and that might be the issue.

 

Hi Lokesh

  Thanks for your reply

   I haven't selected any format, left that to a default format - 'm/d/Y' . If i make the format as 'Y-m-d' the content is getting stored with Date format as per ISO8601 standards. Overall i want to save the date in a String format.

 

Thank you

Translate