Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

Datepicker from Granite Foundation - How do you change the property type to Date instead of String

Avatar

Level 1

I am using the datepicker component (granite/ui/components/foundation/form/datepicker) for a new field in the Touch UI, but it saves it as a String property in the node, rather than a Date.  We do querybuilder searches with Dates, and it doesn't seem to work when that field is a String, but it works as a date.

How do I change it so that this component saves this value with type Date rather than String?

1 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Level 10

Another option that you can do is to take the String returned from the component and convert the value to a Date via JavaScript. See: 

http://www.mattkruse.com/javascript/date/

Then you can assign that Date value to the JCR node.  

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten

Avatar

Level 10

did you tried adding an hidden variable @TypeHint of type date?

Avatar

Korrekte Antwort von
Level 10

Another option that you can do is to take the String returned from the component and convert the value to a Date via JavaScript. See: 

http://www.mattkruse.com/javascript/date/

Then you can assign that Date value to the JCR node.