// formatDateTimeComponentMonth renders a month component.
170065
func (t *Translator) formatDateTimeComponentMonth(datetime time.Time, length int) (string, error) {

	month := int(datetime.Month())

	switch length {
	case datetimeFormatLength1Plus:
		return t.formatDateTimeComponentMonth1Plus(month), nil
	case datetimeFormatLength2Plus:
		return t.formatDateTimeComponentMonth2Plus(month), nil
	case datetimeFormatLengthAbbreviated:
		return t.formatDateTimeComponentMonthAbbreviated(month), nil
	case datetimeFormatLengthWide:
		return t.formatDateTimeComponentMonthWide(month), nil
	case datetimeFormatLengthNarrow:
		return t.formatDateTimeComponentMonthNarrow(month), nil
	}

	return "", translatorError{message: fmt.Sprintf("unsupported month length: %d", length)}
}
933043
func (t Time) DateFormat(layout string) (string, error) {
	var buf bytes.Buffer
	inPatternMatch := false
	for _, b := range layout {
		if inPatternMatch {
			if err := t.convertDateFormat(b, &buf); err != nil {
				return "", errors.Trace(err)
			}
			inPatternMatch = false
			continue
		}

		// It's not in pattern match now.
		if b == '%' {
			inPatternMatch = true
		} else {
			buf.WriteRune(b)
		}
	}
	return buf.String(), nil
}
418398
func (sr *sr_Cyrl_ME) MonthWide(month time.Month) string {
	return sr.monthsWide[month]
}
1124569
func EntireMonth(year int, month time.Month) (term Range) {
	first := time.Date(year, month, 1, 0, 0, 0, 0, time.UTC)
	term.End = FromTime(first.AddDate(0, 1, -1))
	term.Start = FromTime(first)
	return
}
1372125
func (c Calendar) formatDateTime(datetime time.Time, pattern []*datetimePatternComponent) (string, error) {
	formatted := ""
	for _, component := range pattern {
		if component.componentType == datetimePatternComponentLiteral {
			formatted += component.pattern
		} else {
			f, err := c.formatDateTimeComponent(datetime, component.pattern)
			if err != nil {
				return "", err
			}
			formatted += f
		}
	}

	return strings.Trim(formatted, " ,"), nil
}
936813
func (nl *nl) MonthWide(month time.Month) string {
	return nl.monthsWide[month]
}
951997
func (t *Translator) formatDateTimeComponentMonthAbbreviated(month int) string {
	switch month {
	case 1:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month1
	case 2:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month2
	case 3:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month3
	case 4:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month4
	case 5:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month5
	case 6:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month6
	case 7:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month7
	case 8:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month8
	case 9:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month9
	case 10:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month10
	case 11:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month11
	case 12:
		return t.rules.DateTime.FormatNames.Months.Abbreviated.Month12
	}

	return ""
}
1331086
func ioOutputFormatMonth(ld *LineData, b *bytes.Buffer) error {
	_, err := b.WriteString(fmt.Sprintf("%02d", int(ld.TimeStamp.Month())))
	return err
}
746865
func (ne *ne_NP) MonthWide(month time.Month) string {
	return ne.monthsWide[month]
}
937784
func (my *my_MM) MonthWide(month time.Month) string {
	return my.monthsWide[month]
}
870134
func FormatDateField(key string, val time.Time) (string, string) {
	return key + ";VALUE=DATE", val.Format("20060102")
}
1241769
func (dje *dje_NE) MonthWide(month time.Month) string {
	return dje.monthsWide[month]
}
1230527
func (te *te) MonthWide(month time.Month) string {
	return te.monthsWide[month]
}
939849
func (t *Translator) formatDateTimeComponentYearLength2Plus(year int) string {
	yearShort := year % 100

	if yearShort < 10 {
		return fmt.Sprintf("0%d", yearShort)
	}

	return fmt.Sprintf("%d", yearShort)
}
415086
func (t *Translator) formatDateTimeComponentPeriodAbbreviated(hour int) string {
	if hour < 12 {
		return t.rules.DateTime.FormatNames.Periods.Abbreviated.AM
	}

	return t.rules.DateTime.FormatNames.Periods.Abbreviated.PM
}
368203
func (ja *ja) MonthWide(month time.Month) string {
	return ja.monthsWide[month]
}
743818
func period2Month(period uint64) uint64 {
	if period == 0 {
		return 0
	}

	year, month := period/100, period%100
	if year < 70 {
		year += 2000
	} else if year < 100 {
		year += 1900
	}

	return year*12 + month - 1
}