Added two functions in item_reserve

Specifically, added two functions that calculate the closest day to a
number and another function that works out the day distance.
fixed minor problem
Almost have the range issue fixed