Currently I'm trying to find a solution for this problem TypeError: Member "toTimestamp" is not available in contract DateTime outside of storage , and I decided to take another approach. I've inherited the DateTime
contract and rewritten the method to be as follows:
function _incrementMonths(uint16 _months, uint _timestamp) internal returns (uint){
uint16 year = getYear(_timestamp);
uint16 month = getMonth(_timestamp);
uint16 newMonth = month + _months;
while(newMonth > 12){
newMonth -= 12;
year++;
}
// get new timestamp
uint time = toTimestamp(
year,
newMonth,
getDay(_timestamp),
getHour(_timestamp),
getMinute(_timestamp),
getSecond(_timestamp)
);
}
However now the compiler gives me this new error:
browser/Payroll.sol:326:21: TypeError: No matching declaration found after argument-dependent lookup.
uint time = toTimestamp(
^---------^
Again, the contract I'm referencing is found here: https://github.com/pipermerriam/ethereum-datetime/blob/master/contracts/DateTime.sol . The method I'm calling is found here https://github.com/pipermerriam/ethereum-datetime/blob/master/contracts/DateTime.sol#L165
I've been trying to debug this, but I don't see what is causing this error. What could be the cause?
Edit:
Please see the code in the IDE I've been working with https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.17+commit.bdeb9e52.js&gist=03e5543f137d3ec464462cc190104de3