MDL-41664 core_calendar: replaced class variables that stored minimum and maximum years with functions

Also made slight changes to the existing functions.