code: func (c Calendar) formatDateTimeComponent(datetime time.Time, pattern string) (string, error) {
  	switch pattern[0:1] {
  	case string(datetimeFormatUnitEra):
  		return c.formatDateTimeComponentEra(datetime, len(pattern))
  	case string(datetimeFormatUnitYear):
  		return c.formatDateTimeComponentYear(datetime, len(pattern))
  	case string(datetimeFormatUnitMonth):
  		return c.formatDateTimeComponentMonth(datetime, len(pattern))
  	case string(datetimeFormatUnitDayOfWeek):
  		return c.formatDateTimeComponentDayOfWeek(datetime, len(pattern))
  	case string(datetimeFormatUnitDay):
  		return c.formatDateTimeComponentDay(datetime, len(pattern))
  	case string(datetimeFormatUnitHour12):
  		return c.formatDateTimeComponentHour12(datetime, len(pattern))
  	case string(datetimeFormatUnitHour24):
  		return c.formatDateTimeComponentHour24(datetime, len(pattern))
  	case string(datetimeFormatUnitMinute):
  		return c.formatDateTimeComponentMinute(datetime, len(pattern))
  	case string(datetimeFormatUnitSecond):
  		return c.formatDateTimeComponentSecond(datetime, len(pattern))
  	case string(datetimeFormatUnitPeriod):
  		return c.formatDateTimeComponentPeriod(datetime, len(pattern))
  	case string(datetimeForamtUnitQuarter):
  		return c.formatDateTimeComponentQuarter(datetime, len(pattern))
  	case string(datetimeFormatUnitTimeZone1):
  		fallthrough
  	case string(datetimeFormatUnitTimeZone2):
  		return c.formatDateTimeComponentTimeZone(datetime, len(pattern))
  	}
  
  	return "", errors.New("unknown datetime format unit: " + pattern[0:1])
  }
docs: // formatDateTimeComponent renders a single component of a datetime format
  // pattern.