WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Some dates in 2013 are "invalid"

[Resolved] Some dates in 2013 are "invalid"

Viewing 10 replies - 1 through 10 (of 10 total)
  • I received answer from author:

    Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.

    In other words I just needed to change separator from slash (/) to dash (-] and that solved my issues with “invalid” dates.

    Bob

    @littleracingbob

    That’s fine if you WANT a (-) separator – what if you want to use (/) or another format entirely? jQuery apparently has all sorts of useful formats (see here) but I can’t use the one I want which has no separators:

    ‘D, dd M yy’ (which should produce for example ‘Sunday, 13 January 2013’

    Enclosing it in single or double quotes doesn’t help either. The only thing I can make work so far is a tag like this for the field:

    [date date985 id:my-date date-format:dd-mm-yy first-day:1 change-year ]

    I have just found we have this problem on my site. In the UK dates normally use the / separator really, am I not able to use this anymore?

    Also the datepicker itself has stopped working!

    Do you get any error message from the form?

    Maybe it’s just the same case as I had. Try to change the separator for tests.

    Bob

    @littleracingbob

    Yes changing the separator to a hyphen ‘-‘ eg dd-mm-yy seems to work but if other config fields are breaking the script you’ll have to experiment with stripping back to the most basic possible settings and add one at a time and test.

    Hopefully the developer or someone with some real JS skills will get onto this soon and figure out a fix

    Just escape the ‘-‘.

    As in [date* date-94 date-format:dd\-mm\-yy]

    That works for me, with no validation errors.

    Bob

    @littleracingbob

    Cheers Mattrad. The ‘-‘ separator is actually working fine. I think people were having problems with slashes.

    I’ve also discovered by looking at the PHP code behind the plugin itself that spaces can be replaced with underscores. This means if anyone wants a long date format (like I did) e.g.:

    ‘Wednesday 16 January 2013’

    this can be configured in the shortcode using:

    date-format:DD_dd_MM_yy

    And everything works fine with no validation errors

    thankyou mechanmx this totally fixed the problem, for me it would allow the date to be chosen, then send with no errors, but the results were blank in the sent form, this fixed it however for me

    Hi. Because Im very new to WP I went through the postings but I dont understand where I have the change the code in order to change the date format on the contact form page to the European standart dd/mm/yyyy.

    Thanks in advance.

    Please help me!

    I’m using hungarian WordPress, and no metter what time format I set I always get the “invalid date and time supplies” error. I’ve tried mm/dd/yy, dd/mm/yy, dd-mm-yy, dd.mm.yy and noumberous combinations of these. I’m gonna go insane.

    Thanks in advance

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Some dates in 2013 are "invalid"’ is closed to new replies.