• Resolved Technically Blonde

    (@technically-blonde)


    Does the add-on that lets you use the HTML5 input types for Date-type input handle the internationalization of dates. Currently we have to input dates in US format, we want our guests to be able to input UK date formats.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author xnau webdesign

    (@xnau)

    You shouldn’t need the HTML5 add-on to use British-style date formats with Participants Database, I took steps to make this possible. If you’re having trouble getting that working, I’d like to hear about it.

    HTML5 date fields work great on mobile devices, less so on desktops because support for the datepicker is spotty, and it’s the datepicker that lets the UI avoid trying to interpret a date string.

    Thread Starter Technically Blonde

    (@technically-blonde)

    The problem occurs if the date fields set up as type Date, which seems to expect american date format. With the Date type field 29/07/2017 was not stored and 12/08/2017 was, but displays as 8th December, 2017.

    If the type is text and dates entered as above then they are stored / displayed exactly as entered. But then I cannot sort on the date fields which is important for me.

    Currently the dates are set to type text.

    Plugin Author xnau webdesign

    (@xnau)

    You are correct about PHP be better at interpreting US-style dates,an in particular it doesn’t do well with slashes. With Participants Database, there are two ways to set it up so that a date like 29/07/2017 will be correctly interpreted.

    The first way is that if you have your general date format (settings/general) for your site set to d/m/Y it will interpret 29/07/2017 correctly because it knows you want the day of the month first. the advantage here is that your users can use other date formats as well.

    If you need to have your general date format to something like F j, Y, but you want your users to input dates as d/m/Y then you need to use a setup called “strict dates” where the date input must match a specific format. This is set up in the Participants Database settings under the advanced tab. It’s a good idea to tell your users the exact format your expect them to use.

    The main reason to use a date field instead of a text field is that if you want to do any sorting or filtering based on dates, the field has to be a date field so that can be done correctly.

    Thread Starter Technically Blonde

    (@technically-blonde)

    Thank you. I’m using F j, Y. I have now set up strict dates in the PDB settings and all is working perfectly.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘HTML5 add-on’ is closed to new replies.