Contact Form 7 Datepicker
[resolved] Some dates in 2013 are "invalid" (11 posts)

  1. mechanmx
    Posted 2 years ago #

    I use datepicker in Contact Form 7 at http://www.realpoland.eu

    Some dates in 2013 are unable to choose as "Invalid date supplied." error is showing up.

    <p>Date (required)
        [date* date-529 date-format:dd/mm/yy first-day:1 change-month change-year] </p>

    The code is right, I think. It worked for 2012 dates.

    Thanks in advance for your support.


  2. mechanmx
    Posted 2 years ago #

    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.

  3. Bob
    Posted 2 years ago #

    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 ]

  4. staz1000
    Posted 2 years ago #

    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!

  5. mechanmx
    Posted 2 years ago #

    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.

  6. Bob
    Posted 2 years ago #

    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

  7. mattrad
    Posted 2 years ago #

    Just escape the '-'.

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

    That works for me, with no validation errors.

  8. Bob
    Posted 2 years ago #

    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:


    And everything works fine with no validation errors

  9. macaulus
    Posted 2 years ago #

    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

  10. puhchi
    Posted 2 years ago #

    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.

  11. grudzug
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 Datepicker
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic