gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.29k stars 371 forks source link

Is there an option to internally represent the output of a datetime-field as an actual JS date object? #629

Open 0xgeert opened 6 years ago

0xgeert commented 6 years ago

Currently when doing getValue() on my form, I'm getting back a string representation for the datetime-field as per the format I've set ("DD/MM/YYYY HH:mm:ss" in my case).

It seems more logical to me to always have an internal representation of datetime using an actual Javascript date-object, and only use the format "DD/MM/YYYY HH:mm:ss" for presentation.

Is this supported?

ambischof commented 6 years ago

Not out of the box that I can tell, but you could create a custom field type whose getValue function converts the string into a date.