// formatDateTimeComponentDayOfWeek renders a day-of-week component.
761444
func (t *Translator) formatDateTimeComponentDayOfWeek(datetime time.Time, length int) (string, error) {
	switch length {
	case datetimeFormatLength1Plus:
		return t.formatDateTimeComponentDayOfWeekWide(datetime.Weekday()), nil
	case datetimeFormatLength2Plus:
		return t.formatDateTimeComponentDayOfWeekShort(datetime.Weekday()), nil
	case datetimeFormatLengthAbbreviated:
		return t.formatDateTimeComponentDayOfWeekAbbreviated(datetime.Weekday()), nil
	case datetimeFormatLengthWide:
		return t.formatDateTimeComponentDayOfWeekWide(datetime.Weekday()), nil
	case datetimeFormatLengthNarrow:
		return t.formatDateTimeComponentDayOfWeekNarrow(datetime.Weekday()), nil
	}

	return "", translatorError{message: fmt.Sprintf("unsupported year day-of-week: %d", length)}
}
1339429
func (s *WeeklyStartTime) SetDayOfWeek(v string) *WeeklyStartTime {
	s.DayOfWeek = &v
	return s
}
405011
func (d date) IsWeekendDay(day time.Weekday) bool {
	return day == time.Saturday || day == time.Sunday
}
226553
func (dsb *dsb_DE) WeekdayWide(weekday time.Weekday) string {
	return dsb.daysWide[weekday]
}
292737
func (s *DescribeScheduledAuditOutput) SetDayOfWeek(v string) *DescribeScheduledAuditOutput {
	s.DayOfWeek = &v
	return s
}
1021899
func (c Calendar) Format(datetime time.Time, pattern string) (string, error) {
	parsed, err := c.parseDateTimeFormat(pattern)
	if err != nil {
		return "", err
	}

	return c.formatDateTime(datetime, parsed)
}
769549
func (mfe *mfe) WeekdayShort(weekday time.Weekday) string {
	return mfe.daysShort[weekday]
}
612781
func (de *de_AT) WeekdayShort(weekday time.Weekday) string {
	return de.daysShort[weekday]
}
1244727
func (c Calendar) formatDateTimeComponentMonth2Plus(month int) string {
	if month < 10 {
		return fmt.Sprintf("0%d", month)
	}
	return fmt.Sprintf("%d", month)
}
304963
func (c Calendar) formatDateTimeComponentMonthAbbreviated(month int) string {
	switch month {
	case 1:
		return c.FormatNames.Months.Abbreviated.Jan
	case 2:
		return c.FormatNames.Months.Abbreviated.Feb
	case 3:
		return c.FormatNames.Months.Abbreviated.Mar
	case 4:
		return c.FormatNames.Months.Abbreviated.Apr
	case 5:
		return c.FormatNames.Months.Abbreviated.May
	case 6:
		return c.FormatNames.Months.Abbreviated.Jun
	case 7:
		return c.FormatNames.Months.Abbreviated.Jul
	case 8:
		return c.FormatNames.Months.Abbreviated.Aug
	case 9:
		return c.FormatNames.Months.Abbreviated.Sep
	case 10:
		return c.FormatNames.Months.Abbreviated.Oct
	case 11:
		return c.FormatNames.Months.Abbreviated.Nov
	case 12:
		return c.FormatNames.Months.Abbreviated.Dec
	}

	return ""
}
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)}
}
179968
func (c Calendar) formatDateTimeComponentDayOfWeekNarrow(dayOfWeek time.Weekday) string {
	switch dayOfWeek {
	case time.Sunday:
		return c.FormatNames.Days.Narrow.Sun
	case time.Monday:
		return c.FormatNames.Days.Narrow.Mon
	case time.Tuesday:
		return c.FormatNames.Days.Narrow.Tue
	case time.Wednesday:
		return c.FormatNames.Days.Narrow.Wed
	case time.Thursday:
		return c.FormatNames.Days.Narrow.Thu
	case time.Friday:
		return c.FormatNames.Days.Narrow.Fri
	case time.Saturday:
		return c.FormatNames.Days.Narrow.Sat
	}

	return ""
}
15465
func IsWeekend(date time.Time) bool {
	day := date.Weekday()
	return day == time.Saturday || day == time.Sunday
}
897211
func (c Calendar) formatDateTimeComponentMonthNarrow(month int) string {
	switch month {
	case 1:
		return c.FormatNames.Months.Narrow.Jan
	case 2:
		return c.FormatNames.Months.Narrow.Feb
	case 3:
		return c.FormatNames.Months.Narrow.Mar
	case 4:
		return c.FormatNames.Months.Narrow.Apr
	case 5:
		return c.FormatNames.Months.Narrow.May
	case 6:
		return c.FormatNames.Months.Narrow.Jun
	case 7:
		return c.FormatNames.Months.Narrow.Jul
	case 8:
		return c.FormatNames.Months.Narrow.Aug
	case 9:
		return c.FormatNames.Months.Narrow.Sep
	case 10:
		return c.FormatNames.Months.Narrow.Oct
	case 11:
		return c.FormatNames.Months.Narrow.Nov
	case 12:
		return c.FormatNames.Months.Narrow.Dec
	}

	return ""
}
664407
func FormatDateTimeField(key string, val time.Time) (string, string) {
	return key + ";VALUE=DATE-TIME", val.Format("20060102T150405")
}
1246263
func (t *Translator) FormatDateTime(format int, datetime time.Time) (string, error) {
	pattern := ""
	switch format {
	case DateFormatFull:
		pattern = t.rules.DateTime.Formats.Date.Full
	case DateFormatLong:
		pattern = t.rules.DateTime.Formats.Date.Long
	case DateFormatMedium:
		pattern = t.rules.DateTime.Formats.Date.Medium
	case DateFormatShort:
		pattern = t.rules.DateTime.Formats.Date.Short
	case TimeFormatFull:
		pattern = t.rules.DateTime.Formats.Time.Full
	case TimeFormatLong:
		pattern = t.rules.DateTime.Formats.Time.Long
	case TimeFormatMedium:
		pattern = t.rules.DateTime.Formats.Time.Medium
	case TimeFormatShort:
		pattern = t.rules.DateTime.Formats.Time.Short
	case DateTimeFormatFull:
		datePattern := strings.Trim(t.rules.DateTime.Formats.Date.Full, " ,")
		timePattern := strings.Trim(t.rules.DateTime.Formats.Time.Full, " ,")
		pattern = getDateTimePattern(t.rules.DateTime.Formats.DateTime.Full, datePattern, timePattern)
	case DateTimeFormatLong:
		datePattern := strings.Trim(t.rules.DateTime.Formats.Date.Long, " ,")
		timePattern := strings.Trim(t.rules.DateTime.Formats.Time.Long, " ,")
		pattern = getDateTimePattern(t.rules.DateTime.Formats.DateTime.Long, datePattern, timePattern)
	case DateTimeFormatMedium:
		datePattern := strings.Trim(t.rules.DateTime.Formats.Date.Medium, " ,")
		timePattern := strings.Trim(t.rules.DateTime.Formats.Time.Medium, " ,")
		pattern = getDateTimePattern(t.rules.DateTime.Formats.DateTime.Medium, datePattern, timePattern)
	case DateTimeFormatShort:
		datePattern := strings.Trim(t.rules.DateTime.Formats.Date.Short, " ,")
		timePattern := strings.Trim(t.rules.DateTime.Formats.Time.Short, " ,")
		pattern = getDateTimePattern(t.rules.DateTime.Formats.DateTime.Short, datePattern, timePattern)
	default:
		return "", translatorError{message: "unknown datetime format" + pattern[0:1]}
	}

	parsed, err := t.parseDateTimeFormat(pattern)
	if err != nil {
		return "", err
	}

	return t.formatDateTime(datetime, parsed)
}
1156873
func formatListTime(t keybase1.Time) string {
	layout := "2006-01-02 15:04:05"
	return keybase1.FromTime(t).Format(layout)
}