...

Source file src/github.com/go-playground/locales/bez/bez.go

Documentation: github.com/go-playground/locales/bez

     1  package bez
     2  
     3  import (
     4  	"math"
     5  	"strconv"
     6  	"time"
     7  
     8  	"github.com/go-playground/locales"
     9  	"github.com/go-playground/locales/currency"
    10  )
    11  
    12  type bez struct {
    13  	locale             string
    14  	pluralsCardinal    []locales.PluralRule
    15  	pluralsOrdinal     []locales.PluralRule
    16  	pluralsRange       []locales.PluralRule
    17  	decimal            string
    18  	group              string
    19  	minus              string
    20  	percent            string
    21  	perMille           string
    22  	timeSeparator      string
    23  	inifinity          string
    24  	currencies         []string // idx = enum of currency code
    25  	monthsAbbreviated  []string
    26  	monthsNarrow       []string
    27  	monthsWide         []string
    28  	daysAbbreviated    []string
    29  	daysNarrow         []string
    30  	daysShort          []string
    31  	daysWide           []string
    32  	periodsAbbreviated []string
    33  	periodsNarrow      []string
    34  	periodsShort       []string
    35  	periodsWide        []string
    36  	erasAbbreviated    []string
    37  	erasNarrow         []string
    38  	erasWide           []string
    39  	timezones          map[string]string
    40  }
    41  
    42  // New returns a new instance of translator for the 'bez' locale
    43  func New() locales.Translator {
    44  	return &bez{
    45  		locale:             "bez",
    46  		pluralsCardinal:    []locales.PluralRule{2, 6},
    47  		pluralsOrdinal:     nil,
    48  		pluralsRange:       nil,
    49  		timeSeparator:      ":",
    50  		currencies:         []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MRU", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TSh", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UYW", "UZS", "VEB", "VEF", "VES", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
    51  		monthsAbbreviated:  []string{"", "Hut", "Vil", "Dat", "Tai", "Han", "Sit", "Sab", "Nan", "Tis", "Kum", "Kmj", "Kmb"},
    52  		monthsNarrow:       []string{"", "H", "V", "D", "T", "H", "S", "S", "N", "T", "K", "K", "K"},
    53  		monthsWide:         []string{"", "pa mwedzi gwa hutala", "pa mwedzi gwa wuvili", "pa mwedzi gwa wudatu", "pa mwedzi gwa wutai", "pa mwedzi gwa wuhanu", "pa mwedzi gwa sita", "pa mwedzi gwa saba", "pa mwedzi gwa nane", "pa mwedzi gwa tisa", "pa mwedzi gwa kumi", "pa mwedzi gwa kumi na moja", "pa mwedzi gwa kumi na mbili"},
    54  		daysAbbreviated:    []string{"Mul", "Vil", "Hiv", "Hid", "Hit", "Hih", "Lem"},
    55  		daysNarrow:         []string{"M", "J", "H", "H", "H", "W", "J"},
    56  		daysWide:           []string{"pa mulungu", "pa shahuviluha", "pa hivili", "pa hidatu", "pa hitayi", "pa hihanu", "pa shahulembela"},
    57  		periodsAbbreviated: []string{"pamilau", "pamunyi"},
    58  		periodsWide:        []string{"pamilau", "pamunyi"},
    59  		erasAbbreviated:    []string{"KM", "BM"},
    60  		erasNarrow:         []string{"", ""},
    61  		erasWide:           []string{"Kabla ya Mtwaa", "Baada ya Mtwaa"},
    62  		timezones:          map[string]string{"ACDT": "ACDT", "ACST": "ACST", "ACWDT": "ACWDT", "ACWST": "ACWST", "ADT": "ADT", "AEDT": "AEDT", "AEST": "AEST", "AKDT": "AKDT", "AKST": "AKST", "ARST": "ARST", "ART": "ART", "AST": "AST", "AWDT": "AWDT", "AWST": "AWST", "BOT": "BOT", "BT": "BT", "CAT": "CAT", "CDT": "CDT", "CHADT": "CHADT", "CHAST": "CHAST", "CLST": "CLST", "CLT": "CLT", "COST": "COST", "COT": "COT", "CST": "CST", "ChST": "ChST", "EAT": "EAT", "ECT": "ECT", "EDT": "EDT", "EST": "EST", "GFT": "GFT", "GMT": "GMT", "GST": "GST", "GYT": "GYT", "HADT": "HADT", "HAST": "HAST", "HAT": "HAT", "HECU": "HECU", "HEEG": "HEEG", "HENOMX": "HENOMX", "HEOG": "HEOG", "HEPM": "HEPM", "HEPMX": "HEPMX", "HKST": "HKST", "HKT": "HKT", "HNCU": "HNCU", "HNEG": "HNEG", "HNNOMX": "HNNOMX", "HNOG": "HNOG", "HNPM": "HNPM", "HNPMX": "HNPMX", "HNT": "HNT", "IST": "IST", "JDT": "JDT", "JST": "JST", "LHDT": "LHDT", "LHST": "LHST", "MDT": "MDT", "MESZ": "MESZ", "MEZ": "MEZ", "MST": "MST", "MYT": "MYT", "NZDT": "NZDT", "NZST": "NZST", "OESZ": "OESZ", "OEZ": "OEZ", "PDT": "PDT", "PST": "PST", "SAST": "SAST", "SGT": "SGT", "SRT": "SRT", "TMST": "TMST", "TMT": "TMT", "UYST": "UYST", "UYT": "UYT", "VET": "VET", "WARST": "WARST", "WART": "WART", "WAST": "WAST", "WAT": "WAT", "WESZ": "WESZ", "WEZ": "WEZ", "WIB": "WIB", "WIT": "WIT", "WITA": "WITA", "∅∅∅": "∅∅∅"},
    63  	}
    64  }
    65  
    66  // Locale returns the current translators string locale
    67  func (bez *bez) Locale() string {
    68  	return bez.locale
    69  }
    70  
    71  // PluralsCardinal returns the list of cardinal plural rules associated with 'bez'
    72  func (bez *bez) PluralsCardinal() []locales.PluralRule {
    73  	return bez.pluralsCardinal
    74  }
    75  
    76  // PluralsOrdinal returns the list of ordinal plural rules associated with 'bez'
    77  func (bez *bez) PluralsOrdinal() []locales.PluralRule {
    78  	return bez.pluralsOrdinal
    79  }
    80  
    81  // PluralsRange returns the list of range plural rules associated with 'bez'
    82  func (bez *bez) PluralsRange() []locales.PluralRule {
    83  	return bez.pluralsRange
    84  }
    85  
    86  // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bez'
    87  func (bez *bez) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
    88  
    89  	n := math.Abs(num)
    90  
    91  	if n == 1 {
    92  		return locales.PluralRuleOne
    93  	}
    94  
    95  	return locales.PluralRuleOther
    96  }
    97  
    98  // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bez'
    99  func (bez *bez) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
   100  	return locales.PluralRuleUnknown
   101  }
   102  
   103  // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bez'
   104  func (bez *bez) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
   105  	return locales.PluralRuleUnknown
   106  }
   107  
   108  // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
   109  func (bez *bez) MonthAbbreviated(month time.Month) string {
   110  	return bez.monthsAbbreviated[month]
   111  }
   112  
   113  // MonthsAbbreviated returns the locales abbreviated months
   114  func (bez *bez) MonthsAbbreviated() []string {
   115  	return bez.monthsAbbreviated[1:]
   116  }
   117  
   118  // MonthNarrow returns the locales narrow month given the 'month' provided
   119  func (bez *bez) MonthNarrow(month time.Month) string {
   120  	return bez.monthsNarrow[month]
   121  }
   122  
   123  // MonthsNarrow returns the locales narrow months
   124  func (bez *bez) MonthsNarrow() []string {
   125  	return bez.monthsNarrow[1:]
   126  }
   127  
   128  // MonthWide returns the locales wide month given the 'month' provided
   129  func (bez *bez) MonthWide(month time.Month) string {
   130  	return bez.monthsWide[month]
   131  }
   132  
   133  // MonthsWide returns the locales wide months
   134  func (bez *bez) MonthsWide() []string {
   135  	return bez.monthsWide[1:]
   136  }
   137  
   138  // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
   139  func (bez *bez) WeekdayAbbreviated(weekday time.Weekday) string {
   140  	return bez.daysAbbreviated[weekday]
   141  }
   142  
   143  // WeekdaysAbbreviated returns the locales abbreviated weekdays
   144  func (bez *bez) WeekdaysAbbreviated() []string {
   145  	return bez.daysAbbreviated
   146  }
   147  
   148  // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
   149  func (bez *bez) WeekdayNarrow(weekday time.Weekday) string {
   150  	return bez.daysNarrow[weekday]
   151  }
   152  
   153  // WeekdaysNarrow returns the locales narrow weekdays
   154  func (bez *bez) WeekdaysNarrow() []string {
   155  	return bez.daysNarrow
   156  }
   157  
   158  // WeekdayShort returns the locales short weekday given the 'weekday' provided
   159  func (bez *bez) WeekdayShort(weekday time.Weekday) string {
   160  	return bez.daysShort[weekday]
   161  }
   162  
   163  // WeekdaysShort returns the locales short weekdays
   164  func (bez *bez) WeekdaysShort() []string {
   165  	return bez.daysShort
   166  }
   167  
   168  // WeekdayWide returns the locales wide weekday given the 'weekday' provided
   169  func (bez *bez) WeekdayWide(weekday time.Weekday) string {
   170  	return bez.daysWide[weekday]
   171  }
   172  
   173  // WeekdaysWide returns the locales wide weekdays
   174  func (bez *bez) WeekdaysWide() []string {
   175  	return bez.daysWide
   176  }
   177  
   178  // Decimal returns the decimal point of number
   179  func (bez *bez) Decimal() string {
   180  	return bez.decimal
   181  }
   182  
   183  // Group returns the group of number
   184  func (bez *bez) Group() string {
   185  	return bez.group
   186  }
   187  
   188  // Group returns the minus sign of number
   189  func (bez *bez) Minus() string {
   190  	return bez.minus
   191  }
   192  
   193  // FmtNumber returns 'num' with digits/precision of 'v' for 'bez' and handles both Whole and Real numbers based on 'v'
   194  func (bez *bez) FmtNumber(num float64, v uint64) string {
   195  
   196  	return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   197  }
   198  
   199  // FmtPercent returns 'num' with digits/precision of 'v' for 'bez' and handles both Whole and Real numbers based on 'v'
   200  // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
   201  func (bez *bez) FmtPercent(num float64, v uint64) string {
   202  	return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   203  }
   204  
   205  // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bez'
   206  func (bez *bez) FmtCurrency(num float64, v uint64, currency currency.Type) string {
   207  
   208  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   209  	symbol := bez.currencies[currency]
   210  	l := len(s) + len(symbol) + 0
   211  	count := 0
   212  	inWhole := v == 0
   213  	b := make([]byte, 0, l)
   214  
   215  	for i := len(s) - 1; i >= 0; i-- {
   216  
   217  		if s[i] == '.' {
   218  			b = append(b, bez.decimal[0])
   219  			inWhole = true
   220  			continue
   221  		}
   222  
   223  		if inWhole {
   224  			if count == 3 {
   225  				b = append(b, bez.group[0])
   226  				count = 1
   227  			} else {
   228  				count++
   229  			}
   230  		}
   231  
   232  		b = append(b, s[i])
   233  	}
   234  
   235  	if num < 0 {
   236  		b = append(b, bez.minus[0])
   237  	}
   238  
   239  	// reverse
   240  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   241  		b[i], b[j] = b[j], b[i]
   242  	}
   243  
   244  	if int(v) < 2 {
   245  
   246  		if v == 0 {
   247  			b = append(b, bez.decimal...)
   248  		}
   249  
   250  		for i := 0; i < 2-int(v); i++ {
   251  			b = append(b, '0')
   252  		}
   253  	}
   254  
   255  	b = append(b, symbol...)
   256  
   257  	return string(b)
   258  }
   259  
   260  // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bez'
   261  // in accounting notation.
   262  func (bez *bez) FmtAccounting(num float64, v uint64, currency currency.Type) string {
   263  
   264  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   265  	symbol := bez.currencies[currency]
   266  	l := len(s) + len(symbol) + 0
   267  	count := 0
   268  	inWhole := v == 0
   269  	b := make([]byte, 0, l)
   270  
   271  	for i := len(s) - 1; i >= 0; i-- {
   272  
   273  		if s[i] == '.' {
   274  			b = append(b, bez.decimal[0])
   275  			inWhole = true
   276  			continue
   277  		}
   278  
   279  		if inWhole {
   280  			if count == 3 {
   281  				b = append(b, bez.group[0])
   282  				count = 1
   283  			} else {
   284  				count++
   285  			}
   286  		}
   287  
   288  		b = append(b, s[i])
   289  	}
   290  
   291  	if num < 0 {
   292  
   293  		b = append(b, bez.minus[0])
   294  
   295  	}
   296  
   297  	// reverse
   298  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   299  		b[i], b[j] = b[j], b[i]
   300  	}
   301  
   302  	if int(v) < 2 {
   303  
   304  		if v == 0 {
   305  			b = append(b, bez.decimal...)
   306  		}
   307  
   308  		for i := 0; i < 2-int(v); i++ {
   309  			b = append(b, '0')
   310  		}
   311  	}
   312  
   313  	if num < 0 {
   314  		b = append(b, symbol...)
   315  	} else {
   316  
   317  		b = append(b, symbol...)
   318  	}
   319  
   320  	return string(b)
   321  }
   322  
   323  // FmtDateShort returns the short date representation of 't' for 'bez'
   324  func (bez *bez) FmtDateShort(t time.Time) string {
   325  
   326  	b := make([]byte, 0, 32)
   327  
   328  	if t.Day() < 10 {
   329  		b = append(b, '0')
   330  	}
   331  
   332  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   333  	b = append(b, []byte{0x2f}...)
   334  
   335  	if t.Month() < 10 {
   336  		b = append(b, '0')
   337  	}
   338  
   339  	b = strconv.AppendInt(b, int64(t.Month()), 10)
   340  
   341  	b = append(b, []byte{0x2f}...)
   342  
   343  	if t.Year() > 0 {
   344  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   345  	} else {
   346  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   347  	}
   348  
   349  	return string(b)
   350  }
   351  
   352  // FmtDateMedium returns the medium date representation of 't' for 'bez'
   353  func (bez *bez) FmtDateMedium(t time.Time) string {
   354  
   355  	b := make([]byte, 0, 32)
   356  
   357  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   358  	b = append(b, []byte{0x20}...)
   359  	b = append(b, bez.monthsAbbreviated[t.Month()]...)
   360  	b = append(b, []byte{0x20}...)
   361  
   362  	if t.Year() > 0 {
   363  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   364  	} else {
   365  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   366  	}
   367  
   368  	return string(b)
   369  }
   370  
   371  // FmtDateLong returns the long date representation of 't' for 'bez'
   372  func (bez *bez) FmtDateLong(t time.Time) string {
   373  
   374  	b := make([]byte, 0, 32)
   375  
   376  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   377  	b = append(b, []byte{0x20}...)
   378  	b = append(b, bez.monthsWide[t.Month()]...)
   379  	b = append(b, []byte{0x20}...)
   380  
   381  	if t.Year() > 0 {
   382  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   383  	} else {
   384  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   385  	}
   386  
   387  	return string(b)
   388  }
   389  
   390  // FmtDateFull returns the full date representation of 't' for 'bez'
   391  func (bez *bez) FmtDateFull(t time.Time) string {
   392  
   393  	b := make([]byte, 0, 32)
   394  
   395  	b = append(b, bez.daysWide[t.Weekday()]...)
   396  	b = append(b, []byte{0x2c, 0x20}...)
   397  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   398  	b = append(b, []byte{0x20}...)
   399  	b = append(b, bez.monthsWide[t.Month()]...)
   400  	b = append(b, []byte{0x20}...)
   401  
   402  	if t.Year() > 0 {
   403  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   404  	} else {
   405  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   406  	}
   407  
   408  	return string(b)
   409  }
   410  
   411  // FmtTimeShort returns the short time representation of 't' for 'bez'
   412  func (bez *bez) FmtTimeShort(t time.Time) string {
   413  
   414  	b := make([]byte, 0, 32)
   415  
   416  	if t.Hour() < 10 {
   417  		b = append(b, '0')
   418  	}
   419  
   420  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   421  	b = append(b, bez.timeSeparator...)
   422  
   423  	if t.Minute() < 10 {
   424  		b = append(b, '0')
   425  	}
   426  
   427  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   428  
   429  	return string(b)
   430  }
   431  
   432  // FmtTimeMedium returns the medium time representation of 't' for 'bez'
   433  func (bez *bez) FmtTimeMedium(t time.Time) string {
   434  
   435  	b := make([]byte, 0, 32)
   436  
   437  	if t.Hour() < 10 {
   438  		b = append(b, '0')
   439  	}
   440  
   441  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   442  	b = append(b, bez.timeSeparator...)
   443  
   444  	if t.Minute() < 10 {
   445  		b = append(b, '0')
   446  	}
   447  
   448  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   449  	b = append(b, bez.timeSeparator...)
   450  
   451  	if t.Second() < 10 {
   452  		b = append(b, '0')
   453  	}
   454  
   455  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   456  
   457  	return string(b)
   458  }
   459  
   460  // FmtTimeLong returns the long time representation of 't' for 'bez'
   461  func (bez *bez) FmtTimeLong(t time.Time) string {
   462  
   463  	b := make([]byte, 0, 32)
   464  
   465  	if t.Hour() < 10 {
   466  		b = append(b, '0')
   467  	}
   468  
   469  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   470  	b = append(b, bez.timeSeparator...)
   471  
   472  	if t.Minute() < 10 {
   473  		b = append(b, '0')
   474  	}
   475  
   476  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   477  	b = append(b, bez.timeSeparator...)
   478  
   479  	if t.Second() < 10 {
   480  		b = append(b, '0')
   481  	}
   482  
   483  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   484  	b = append(b, []byte{0x20}...)
   485  
   486  	tz, _ := t.Zone()
   487  	b = append(b, tz...)
   488  
   489  	return string(b)
   490  }
   491  
   492  // FmtTimeFull returns the full time representation of 't' for 'bez'
   493  func (bez *bez) FmtTimeFull(t time.Time) string {
   494  
   495  	b := make([]byte, 0, 32)
   496  
   497  	if t.Hour() < 10 {
   498  		b = append(b, '0')
   499  	}
   500  
   501  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   502  	b = append(b, bez.timeSeparator...)
   503  
   504  	if t.Minute() < 10 {
   505  		b = append(b, '0')
   506  	}
   507  
   508  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   509  	b = append(b, bez.timeSeparator...)
   510  
   511  	if t.Second() < 10 {
   512  		b = append(b, '0')
   513  	}
   514  
   515  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   516  	b = append(b, []byte{0x20}...)
   517  
   518  	tz, _ := t.Zone()
   519  
   520  	if btz, ok := bez.timezones[tz]; ok {
   521  		b = append(b, btz...)
   522  	} else {
   523  		b = append(b, tz...)
   524  	}
   525  
   526  	return string(b)
   527  }
   528  

View as plain text