• Robertmurdock

    (@robertmurdock153)


    Hi Team,

    We’re experiencing an issue with Contact Form 7 v6.2 related to the default date field validation.

    Environment:

    • Contact Form 7 Version: 6.2
    • WordPress: Latest
    • Browser: Google Chrome
    • Date fields:
      [date* sell-by-date1]
      [date date-purchased]

    Issue:
    Some users receive the validation message:

    “The date format is incorrect.”

    even though they select a valid date using the native browser date picker.

    Initially we couldn’t reproduce the issue because our team is located in India. However, after changing the browser timezone using Chrome DevTools → Sensors to America/Los_Angeles (or other US timezones), the issue becomes consistently reproducible. The same form works correctly when the browser timezone is Asia/Kolkata.

    https://prnt.sc/M_7SJLvWSCP0

    After investigating, it appears the problem is in the client-side SWV date validation. It seems the validation parses the submitted date using JavaScript’s new Date('YYYY-MM-DD') and then compares it using local timezone values. In timezones behind UTC, the parsed date becomes the previous day, causing the validation to fail even though the submitted value is correct.

    We also found these existing discussions describing what appears to be the same issue:

    https://wordpress.org/support/topic/contact-form-7-6-2-date-picker-displays-incorrect-date-format-validation-error/

    https://wordpress.org/support/topic/bug-date-format-not-working-in-6-2/

    As a temporary workaround, we’ve overridden the client-side date validation to compare dates using UTC instead of local time, which resolves the issue during our testing while keeping validation intact.

    Could you please confirm:

    1. Is this a known issue in Contact Form 7 v6.2?
    2. Is an official fix planned for a future release?
    3. If available, could you share a development patch or recommended workaround that we can test before the next public release?

    We’d be happy to test any patch or beta fix if needed.

    Thank you!

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

You must be logged in to reply to this topic.