
27 Mar
2006
27 Mar
'06
6:27 a.m.
date_period contract(const date_period& dp, days len) { if (dp.length() < len) { //handle errors here -- after contraction nothing is left... } return date_period(dp.start() + len, dp.end()-len); }
In use: date_period dp(....); dp = contract(dp, days(2));
thanks Jeff,I will go this way. I suggest you to add also this functionality in a next version(1.34.1(?)) it's very usefull. thanks