Title: compute days between date fields
Last modified: February 20, 2017

---

# compute days between date fields

 *  [kiekers](https://wordpress.org/support/users/kiekers/)
 * (@kiekers)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/compute-days-between-date-fields/)
 * Hi,
 * Is there any way to compute the value between two date fields? For instance, 
   I have an arrival date and a departure date on my product, and want to automatically
   calculate the number of days that the person will be staying.
 * I am very comfortable using hooks and filters in order to customise plugins, 
   just need a point in the right direction.
 * Thanks,

Viewing 1 replies (of 1 total)

 *  [sarkparanjothi](https://wordpress.org/support/users/sarkparanjothi/)
 * (@sarkparanjothi)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/compute-days-between-date-fields/#post-8838579)
 * if you using date format dd/mm/yy
    `NumberOfDays = parseInt( $( "#startDate" ).
   val() ) - parseInt( $( "#endDate" ).val() );`
 * example : `parseInt("15/12/2016") - parseInt("10/12/2016");`

Viewing 1 replies (of 1 total)

The topic ‘compute days between date fields’ is closed to new replies.

 * ![](https://ps.w.org/wc-fields-factory/assets/icon-128x128.jpg?rev=2738843)
 * [WC Fields Factory](https://wordpress.org/plugins/wc-fields-factory/)
 * [Support Threads](https://wordpress.org/support/plugin/wc-fields-factory/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-fields-factory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-fields-factory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-fields-factory/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [sarkparanjothi](https://wordpress.org/support/users/sarkparanjothi/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/compute-days-between-date-fields/#post-8838579)
 * Status: not resolved