In case this helps anyone else needing to calculate the number of days between two dates in an item, here’s the calculation field formula:
var d1 = moment(@StartDate);
var d2 = moment(@FinishDate);
var result = d2.diff(d1, 'days')+1;
where @StartDate and @FinishDate are the date fields (in the formula, you need to replace the date variables text with an “@” and then select the date field from the Podio list of variables).
Also note that two separate date fields are required. This won’t work with a single date field that has both a start and end date (per someone else’s comments, Podio will only return the first date in this situation).
Please sign in to leave a comment.