How to format date in Formulate datepicker field on front-end
Hi,
Any idea how to format date in Formulate datepicker field on front-end?
Currently it is MM-DD-YYYY (month - day - year) but i would like it to be DD-MM-YYYY (day - month - year)
That guide shows how to create an entirely new field type, but you can also just modify the frontend of an existing field type (such as the date field).
Just be sure the value gets sent to the server in the exact same way as it currently does, or weird things might happen.
I assume you're looking for Formulate's built-in date picker. Here are the files you'll be interested in for that:
DateField.cs The server-side field type definition.
dateField.html The back office AngularJS directive template. You probably don't care much about this.
dateField.js The back office AngularJS directive JavaScript. You probably don't care much about this.
builtin-types.js (line 234) The frontend JavaScript to render the field.
index.js (line 28) The frontend JavaScript that associates the field to the rendering function.
Again, you'll want to override the frontend rendering of the field. It's entirely up to you how you want to go about that (e.g., you could use some third-party AngularJS date picker).
How to format date in Formulate datepicker field on front-end
Hi,
Any idea how to format date in Formulate datepicker field on front-end? Currently it is MM-DD-YYYY (month - day - year) but i would like it to be DD-MM-YYYY (day - month - year)
Thanks!
You can display Formulate fields however you like on the frontend: http://www.formulate.rocks/articles/custom-field-types
That guide shows how to create an entirely new field type, but you can also just modify the frontend of an existing field type (such as the date field).
Just be sure the value gets sent to the server in the exact same way as it currently does, or weird things might happen.
Hi Nicholas, thanks! I tried to find the datetime picker field but i can't find it. Any hints?
I assume you're looking for Formulate's built-in date picker. Here are the files you'll be interested in for that:
Again, you'll want to override the frontend rendering of the field. It's entirely up to you how you want to go about that (e.g., you could use some third-party AngularJS date picker).
Thanks for the hints. I will see if i can solve it now.
is working on a reply...