3

I want to use the fairly new input types that HTML5 defines. In Salesforce, the different types are: date, datetime, datetime-local, month, week, time, email, number, range, search, tel, text, and url. When used with doctype="html5", an input field of type date (<apex:input type"date"/>) looks like the following:

enter image description here

Is it possible to make this input, somehow "locale aware"? i.e.: instead of mm/dd/yyyy for example dd.mm.yyyy (Finnish date locale).

Thanks!

  • 1
    The locale the browser/OS drives the format for <input type="date"/> whereas Salesforce carries a locale on each User object. Is relying on the client having their browser/OS set appropriately sufficient for you? – Keith C Nov 7 '14 at 9:58
1

Look here:

https://stackoverflow.com/questions/7372038/is-there-any-way-to-change-input-type-date-format

What is said there is that the date is formatted following the User's locale settings in the browser. No way to override.

You may be be able to use the HTML5 standard date input field to capture the date from the User, and use another field to show the User chosen date. A bit tricky and requires Javascript, but that's it.

| improve this answer | |
  • Thanks!, no need to override, just to be locale aware. So if the input depends on the browser's locale that is enough. – magandrez Nov 7 '14 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.