• Resolved Rose

    (@thorned-rose)


    When using the date field, using the picker formats the date as the WordPress default – F j, Y which outputs as November 2, 2022. That’s all fine. If I manually enter a date, say 2/11/2022 (2 November 2022) then the date field thinks I am entering February 11 2022 – the day and month are reversed. In New Zealand (where we are) the date format is dd/mm/yyyy not mm/dd/yyyy. How can I get consistency in the date picker whilst still allowing manual entry? Thanks!! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Rose

    (@thorned-rose)

    Is it also possible to restrict the past date range to a set date e.g. not allow any date before April 2021?

    EDIT: I’ve been able to partially resolve this by using the guide here: https://acowebs.com/guideline/plugin-docs-faqs/wcpa/datetime-customizations/

    {
    "formatDate":"d/m/Y",
    "mask":"39/19/2099",
    "minDate":"01/04/2021"
    }

    However, the date picker calendar still sets the date format as the WordPress default (November 2, 2022 instead of 02/11/2022) and manually entering a date seems to confuse the date picker calendar for some dates e.g. it can’t make sense of 31/02/2022 because it’s reading it as the 2nd of the 31st month 2022.

    EDIT 2: Setting the WordPress date format as d/m/Y fixes the inconsistent dates and the date picker calendar doesn’t mix up the day and month. However this can’t be a permanent solution as blog articles and the like need to have the F j, Y format.

    • This reply was modified 2 years, 4 months ago by Rose.
    • This reply was modified 2 years, 4 months ago by Rose.
    • This reply was modified 2 years, 4 months ago by Rose.

    Hi,
    If you are using our pro version plugin there is an option to disable the manual input.
    You can enable those to avoid manual input.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Date field format’ is closed to new replies.