Hi, I was wondering if there was a way to format a calculation of ’Months Remaining’ by subtracting one date entry from another, based on the current date, so for example:
Two ’Date’ TVs:
Start Date of Contract [*shareStartDate*]
End Date of Contract [*shareEndDate*]
Using an expression something like the one below, which works with basic numbers, just not a date:
MONTHS OF CONTRACT REMAINING:
[+phx:math=`[*shareStartDate:date=`%m`*]-[*shareEndDate%m:date=`%m`*]`+]
Thanks!
J
If you format the date to unixtime, do the subtratction, and then convert it back again it might work. Haven’t tried though.
You might need to write a custom PHx snippet to do this; I’m sure Google will turn up PHP code for doing this pretty quickly.
I did a bit of a search but I’m pretty basic when it comes to PHP, I thought if there was a straight-forward way to do it I could probably do it...oh well.. I told them to get a real programmer not a designer to do it! ;o)
OK, sorry I couldn’t help there.
By the way: if your programmer does come up with a nice neat PHx snippet for doing it, it might be helpful to other people like you in the future if you posted it back here.
Thanks.
Greats stuff, thanks, that might just work....!