added func to calc of last date of month based on given date
added search periods for previous years