Wordpress contact form 7 compare dates

53
March 12, 2019, at 8:10 PM

I am using a contact form 7 plugin. I have two dates fields - date-from and date-to. When I am clicking on date-to,i must calculate the difference between date-from and date-to with jquery function. If it is more than 6 months - it is ok, but if is less 6 months i must show error message. The problem is when i try to check diff dates, i catch error DateTime is not a function ot strtotime is not a function. How to check difference between date-from and date-to?

<div class="col-xs-12 col-sm-3">
    <label> Date From: <span style="color: red"> * </span>
[date date-from id:date-from]</label>
   </div>
<div class="col-xs-12 col-sm-3">
        <label> Date to: <span style="color: red"> * </span>
    [date date-to id:date-to]</label>
   </div>
</div>

and the jquery

$dateto.blur(function(datefrom, dateto){
  var date1 = new Date(2010, 6, 17);
var date2 = new Date(2013, 12, 18);
var diff = new Date(date2.getTime() - date1.getTime());
console.log(diff.getUTCMonth());
});

// here i catch error getTime is not a function

READ ALSO
Uploading node_modules to Nexus hosted NPM repository

Uploading node_modules to Nexus hosted NPM repository

We are building our project in offline build serverThus we have to store and maintain all our project dependencies in local network Nexus

67
Detect when the user has changed the order of a sortable table

Detect when the user has changed the order of a sortable table

I am currently trying to see if there is a way to detect when the user changes the order of a sortable tableI have the table set up with the code

43
HTML form that causes a GET request

HTML form that causes a GET request

Basic questionIf I have a form in my HTML (where in my case someone inputs a date), how can I have my users cause a GET request with the contents of that form instead of a POST

16
ModuleNotFoundError: No module named &#39;freenect&#39;

ModuleNotFoundError: No module named 'freenect'

I installed libfreenect using the following tutorial: https://naman5wordpress

28