moved getDuration into utils package
refactor to use daysinmonth function