Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Wordpress - Contact Form 7

  • 09-01-2014 2:47pm
    #1
    Registered Users, Registered Users 2 Posts: 437 ✭✭


    Hi there,

    Does anybody know how to format the date output (in the "mail" section of the admin page of Contact Form 7) nicely, such as with the date() function in PHP?

    On the "Date" page of the CF7 documentation it mentions something along those lines. Unfortunately it's not accessible at the moment, but I thought I'd post here to see if anyone has any wise words to offer.

    Thanks in advance!

    Edit: Link to the relevant CF7 page: http://contactform7.com/date-field/


Comments

  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew


    What have you tried and what ends up in your emails?


  • Registered Users, Registered Users 2 Posts: 437 ✭✭t1mm


    I've tried a few things (and in both the "form" and "message body" fields). My date field is called date-940 btw.
    [_format_date-940 "D, d M y"]
    [date-940 "D, d M y"]
    

    Neither of these get parsed by the plugin, and end up displaying in the email exactly as they're written in the admin forms. Any ideas?


  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew


    It worked for me.

    My form has:
    [HTML]<p>Date<br />
    [date date-204 min:2013-01-01 max:2014-12-31 step:2]</p>[/HTML]
    and the email template has:
    [HTML]Date: [date-204]
    Formatted date: [_format_date-204 "D, d M y"][/HTML]

    On the form I entered the date: 2014-02-07

    and my email had:
    [HTML]Date: 2014-02-07
    Formatted date: Fri, 07 Feb 14[/HTML]

    Entering the date in that format is not intuitive - the field should use jQuery UI Datepicker. I am sure that someone could write an addon plugin to trigger the datapicker on input.wpcf7-date.


  • Registered Users, Registered Users 2 Posts: 437 ✭✭t1mm


    Hi daymobrew,

    Thanks a million for taking the time to reply. I've directly copied the code you've pasted, and it still doesn't work.

    I'm using a plugin called "Contact Form 7 Datepicker" which may be causing an issue. Are you using an un-altered version of CF7?

    Thanks again for your help!


  • Registered Users, Registered Users 2 Posts: 437 ✭✭t1mm


    I've just disabled that plugin, and still having issues. The field forces me to enter a date in the format dd/mm/yyyy whereas your above example seems to be a bit different. Any thoughts?

    Thanks again


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,571 ✭✭✭daymobrew


    I am using Contact Form 7 version 3.6. It is not modified in any way.

    If you'd be okay with giving me an Editor account on your site I can have a look.


  • Registered Users, Registered Users 2 Posts: 437 ✭✭t1mm


    Daymobrew,

    Just updated the plugin and it's working now. Thanks very much for your help :)

    Cheers!


Advertisement