gregorian_calendar::end_of_month_day returns unsigned short and date constructor uses unsigned short too.