code: function(year, error) {
          if (year.year) {
              year = year.year();
          }
  
          if (typeof year !== 'number' || year < 1888 || year > 2111) {
              throw error.replace(/\{0\}/, this.local.name);
          }
  
          return year;
      }
docs: Check that a candidate date is from the same calendar and is valid.
  @memberof BaseCalendar
  @private
  @param year {CDate|number} The date or the year to validate.
  @param error {string} Error message if invalid.
  @return {number} The year.
  @throws Error if year out of range.