code: func (c Calendar) formatDateTimeComponentPeriod(datetime time.Time, length int) (string, error) {
  	hour := datetime.Hour()
  
  	switch length {
  	case datetimeFormatLength1Plus:
  		return c.formatDateTimeComponentPeriodWide(hour), nil
  	case datetimeFormatLengthAbbreviated:
  		return c.formatDateTimeComponentPeriodAbbreviated(hour), nil
  	case datetimeFormatLengthWide:
  		return c.formatDateTimeComponentPeriodWide(hour), nil
  	case datetimeFormatLengthNarrow:
  		return c.formatDateTimeComponentPeriodNarrow(hour), nil
  	}
  
  	return "", fmt.Errorf("unsupported day-period: %d", length)
  }
docs: // formatDateTimeComponentPeriod renders a period component (AM/PM).