Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Today's Date in Contact Form 7 date picker

I am new to WordPress and contact form 7. Is there any possibility to get today's date in the contact form 7 datepicker by default? I have this short-code is [date* date-299 min-date:0 first-day:1]. It didn't work for me. Is there any necessity for Hooks/Actions?

Help required!!

Thanks in advance.

like image 971
Beula Epsiba Avatar asked Aug 17 '16 09:08

Beula Epsiba


3 Answers

In case someone is still looking for the better answer, it is in documentation: https://contactform7.com/date-field/

My date field example:

[date date-479 date-format:mm/dd/yy min:today+2days]

Notice, that only works with min!!! min-date doesn't work. :)

like image 136
Deividas Cha Avatar answered Oct 21 '22 02:10

Deividas Cha


You can set it up using Jquery

var date = new Date();
$("#dates").datepicker({
dateFormat: 'd-M-y'
}).datepicker('setDate', date);

Where #date is the ID of the Text box field

like image 38
Naresh Kumar P Avatar answered Oct 21 '22 03:10

Naresh Kumar P


After a lot of searching, the below method is working for me:

[date* date-775 date-format:YYYY-MM-DD min:today+1days  id:date class:date]
like image 2
Imran Khan Avatar answered Oct 21 '22 04:10

Imran Khan