I have an MVC 5 application that will be used world wide. A number of the pages in the app will require users to enter dates. I'll be using the jQuery datetimepicker plug-in to allow the user to select dates. Or they can enter them manually.

I'm curious what the best practice is for cultures where dates are entered in the dd/mm/yyyy format instead of mm/dd/yyyy? I could require all dates to be entered in mm/dd/yyyy format, which is the format my app is expecting, but I also don't want to cause too much angst with my users in other parts of the world.

  • just show the dd/MM/yyyy string as they are entering it, or use separate textboxes each with the proper label. either way this is a question for UX.SE – ratchet freak May 17 '14 at 17:21
  • 2
    and I found the question related to that for you. – ratchet freak May 17 '14 at 17:25
  • Very relevant: en.wikipedia.org/wiki/Date_format_by_country – so figure out the user's locale and switch to the appropriate format (with a clear visual indication of the format you're expecting). Or just follow the ISO 8601 standard – it's the international standard for good reasons. Or sidestep the issue via a graphical date picker that does not require textual input. – amon May 17 '14 at 18:51
  • 1
    @amon: don't go by country based on IP. When I am traveling my location will be different from my regional preferences. – Marjan Venema May 18 '14 at 10:06
  • @ratchetfreak: Good find. Randy: don't go coding supporting different regional formats yourself. It's a waste of time and you'll probably miss stuff. Can't recall the name right now, but there is a jQuery internationalization / validation library that will/should take care of this. Search for those terms and you will find it. – Marjan Venema May 18 '14 at 10:08

Your Answer

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

Browse other questions tagged or ask your own question.