OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-playground / locales / mn / mn.go
1 package mn
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 mn 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         currencyPositivePrefix string
26         currencyNegativePrefix string
27         monthsAbbreviated      []string
28         monthsNarrow           []string
29         monthsWide             []string
30         daysAbbreviated        []string
31         daysNarrow             []string
32         daysShort              []string
33         daysWide               []string
34         periodsAbbreviated     []string
35         periodsNarrow          []string
36         periodsShort           []string
37         periodsWide            []string
38         erasAbbreviated        []string
39         erasNarrow             []string
40         erasWide               []string
41         timezones              map[string]string
42 }
43
44 // New returns a new instance of translator for the 'mn' locale
45 func New() locales.Translator {
46         return &mn{
47                 locale:                 "mn",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{6},
50                 pluralsRange:           []locales.PluralRule{2, 6},
51                 decimal:                ".",
52                 group:                  ",",
53                 minus:                  "-",
54                 percent:                "%",
55                 perMille:               "‰",
56                 timeSeparator:          ":",
57                 inifinity:              "∞",
58                 currencies:             []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "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", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNX", "CN¥", "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", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "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", "₮", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "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", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
59                 currencyPositivePrefix: " ",
60                 currencyNegativePrefix: " ",
61                 monthsAbbreviated:      []string{"", "1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"},
62                 monthsNarrow:           []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
63                 monthsWide:             []string{"", "Нэгдүгээр сар", "Хоёрдугаар сар", "Гуравдугаар сар", "Дөрөвдүгээр сар", "Тавдугаар сар", "Зургадугаар сар", "Долдугаар сар", "Наймдугаар сар", "Есдүгээр сар", "Аравдугаар сар", "Арван нэгдүгээр сар", "Арван хоёрдугаар сар"},
64                 daysAbbreviated:        []string{"Ня", "Да", "Мя", "Лх", "Пү", "Ба", "Бя"},
65                 daysNarrow:             []string{"Ня", "Да", "Мя", "Лх", "Пү", "Ба", "Бя"},
66                 daysShort:              []string{"Ня", "Да", "Мя", "Лх", "Пү", "Ба", "Бя"},
67                 daysWide:               []string{"ням", "даваа", "мягмар", "лхагва", "пүрэв", "баасан", "бямба"},
68                 periodsAbbreviated:     []string{"ҮӨ", "ҮХ"},
69                 periodsNarrow:          []string{"үө", "үх"},
70                 periodsWide:            []string{"ү.ө", "ү.х"},
71                 erasAbbreviated:        []string{"м.э.ө", "м.э."},
72                 erasNarrow:             []string{"МЭӨ", "МЭ"},
73                 erasWide:               []string{"манай эриний өмнөх", "манай эриний"},
74                 timezones:              map[string]string{"NZDT": "Шинэ Зеландын зуны цаг", "CHADT": "Чатемын зуны цаг", "HEPM": "Сент-Пьер ба Микелоны зуны цаг", "BT": "Бутаны цаг", "AWST": "Австралийн баруун эргийн стандарт цаг", "AEST": "Австралийн зүүн эргийн стандарт цаг", "AEDT": "Австралийн зүүн эргийн зуны цаг", "AKDT": "Аляскийн зуны цаг", "ACST": "Төв Австралийн стандарт цаг", "CST": "Төв стандарт цаг", "UYST": "Уругвайн зуны цаг", "LHST": "Лорд Хоугийн стандарт цаг", "AST": "Атлантын стандарт цаг", "HAT": "Нью-Фаундлендын зуны цаг", "HKT": "Хонг Конгийн стандарт цаг", "∅∅∅": "Перугийн зуны цаг", "MST": "MST", "AWDT": "Австралийн баруун эргийн зуны цаг", "JST": "Японы стандарт цаг", "SRT": "Суринамын цаг", "ACWST": "Австралийн төв баруун эргийн стандарт цаг", "ECT": "Эквадорын цаг", "EST": "Зүүн эргийн стандарт цаг", "HEPMX": "Мексикийн номхон далайн зуны цаг", "HECU": "Кубын зуны цаг", "NZST": "Шинэ Зеландын стандарт цаг", "OESZ": "Зүүн Европын зуны цаг", "HNPMX": "Мексикийн номхон далайн стандарт цаг", "VET": "Венесуэлийн цаг", "HEOG": "Баруун Гринландын зуны цаг", "HEEG": "Зүүн Гринландын зуны цаг", "WIT": "Зүүн Индонезийн цаг", "TMT": "Туркменистаны стандарт цаг", "HNOG": "Баруун Гринландын стандарт цаг", "WEZ": "Баруун Европын стандарт цаг", "CHAST": "Чатемын стандарт цаг", "HNPM": "Сент-Пьерре ба Микелоны стандарт цаг", "MDT": "MDT", "MYT": "Малайзын цаг", "EDT": "Зүүн эргийн зуны цаг", "AKST": "Аляскийн стандарт цаг", "CLST": "Чилийн зуны цаг", "MESZ": "Төв Европын зуны цаг", "OEZ": "Зүүн Европын стандарт цаг", "LHDT": "Лорд Хоугийн зуны цаг", "CLT": "Чилийн стандарт цаг", "HKST": "Хонг Конгийн зуны цаг", "COT": "Колумбын стандарт цаг", "COST": "Колумбын зуны цаг", "GFT": "Францын Гияанагийн цаг", "GMT": "Гринвичийн үндсэн цаг", "PDT": "Номхон далайн зуны цаг", "UYT": "Уругвайн стандарт цаг", "TMST": "Туркменистаны зуны цаг", "HENOMX": "Баруун хойд Мексикийн зуны цаг", "ART": "Аргентины стандарт цаг", "EAT": "Зүүн Африкийн цаг", "SAST": "Өмнөд Африкийн стандарт цаг", "PST": "Номхон далайн стандарт цаг", "CDT": "Төв зуны цаг", "ACWDT": "Австралийн төв баруун эргийн зуны цаг", "MEZ": "Төв Европын стандарт цаг", "WAST": "Баруун Африкийн зуны цаг", "ACDT": "Төв Австралийн зуны цаг", "ADT": "Атлантын зуны цаг", "ARST": "Аргентины зуны цаг", "WIB": "Баруун Индонезийн цаг", "HNCU": "Кубын стандарт цаг", "HAST": "Хавай-Алеутын стандарт цаг", "IST": "Энэтхэгийн цаг", "WITA": "Төв Индонезийн цаг", "WARST": "Баруун Аргентины зуны цаг", "WAT": "Баруун Африкийн стандарт цаг", "GYT": "Гуяанагийн цаг", "HADT": "Хавай-Алеутын зуны цаг", "JDT": "Японы зуны цаг", "HNT": "Нью-Фаундлендын стандарт цаг", "SGT": "Сингапурын цаг", "ChST": "Чаморрогийн цаг", "BOT": "Боливийн цаг", "HNNOMX": "Баруун хойд Мексикийн стандарт цаг", "CAT": "Төв Африкийн цаг", "WESZ": "Баруун Европын зуны цаг", "WART": "Баруун Аргентины стандарт цаг", "HNEG": "Зүүн Гринландын стандарт цаг"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (mn *mn) Locale() string {
80         return mn.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'mn'
84 func (mn *mn) PluralsCardinal() []locales.PluralRule {
85         return mn.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'mn'
89 func (mn *mn) PluralsOrdinal() []locales.PluralRule {
90         return mn.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'mn'
94 func (mn *mn) PluralsRange() []locales.PluralRule {
95         return mn.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'mn'
99 func (mn *mn) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102
103         if n == 1 {
104                 return locales.PluralRuleOne
105         }
106
107         return locales.PluralRuleOther
108 }
109
110 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'mn'
111 func (mn *mn) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
112         return locales.PluralRuleOther
113 }
114
115 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'mn'
116 func (mn *mn) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
117
118         start := mn.CardinalPluralRule(num1, v1)
119         end := mn.CardinalPluralRule(num2, v2)
120
121         if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
122                 return locales.PluralRuleOther
123         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
124                 return locales.PluralRuleOne
125         }
126
127         return locales.PluralRuleOther
128
129 }
130
131 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
132 func (mn *mn) MonthAbbreviated(month time.Month) string {
133         return mn.monthsAbbreviated[month]
134 }
135
136 // MonthsAbbreviated returns the locales abbreviated months
137 func (mn *mn) MonthsAbbreviated() []string {
138         return mn.monthsAbbreviated[1:]
139 }
140
141 // MonthNarrow returns the locales narrow month given the 'month' provided
142 func (mn *mn) MonthNarrow(month time.Month) string {
143         return mn.monthsNarrow[month]
144 }
145
146 // MonthsNarrow returns the locales narrow months
147 func (mn *mn) MonthsNarrow() []string {
148         return mn.monthsNarrow[1:]
149 }
150
151 // MonthWide returns the locales wide month given the 'month' provided
152 func (mn *mn) MonthWide(month time.Month) string {
153         return mn.monthsWide[month]
154 }
155
156 // MonthsWide returns the locales wide months
157 func (mn *mn) MonthsWide() []string {
158         return mn.monthsWide[1:]
159 }
160
161 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
162 func (mn *mn) WeekdayAbbreviated(weekday time.Weekday) string {
163         return mn.daysAbbreviated[weekday]
164 }
165
166 // WeekdaysAbbreviated returns the locales abbreviated weekdays
167 func (mn *mn) WeekdaysAbbreviated() []string {
168         return mn.daysAbbreviated
169 }
170
171 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
172 func (mn *mn) WeekdayNarrow(weekday time.Weekday) string {
173         return mn.daysNarrow[weekday]
174 }
175
176 // WeekdaysNarrow returns the locales narrow weekdays
177 func (mn *mn) WeekdaysNarrow() []string {
178         return mn.daysNarrow
179 }
180
181 // WeekdayShort returns the locales short weekday given the 'weekday' provided
182 func (mn *mn) WeekdayShort(weekday time.Weekday) string {
183         return mn.daysShort[weekday]
184 }
185
186 // WeekdaysShort returns the locales short weekdays
187 func (mn *mn) WeekdaysShort() []string {
188         return mn.daysShort
189 }
190
191 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
192 func (mn *mn) WeekdayWide(weekday time.Weekday) string {
193         return mn.daysWide[weekday]
194 }
195
196 // WeekdaysWide returns the locales wide weekdays
197 func (mn *mn) WeekdaysWide() []string {
198         return mn.daysWide
199 }
200
201 // Decimal returns the decimal point of number
202 func (mn *mn) Decimal() string {
203         return mn.decimal
204 }
205
206 // Group returns the group of number
207 func (mn *mn) Group() string {
208         return mn.group
209 }
210
211 // Group returns the minus sign of number
212 func (mn *mn) Minus() string {
213         return mn.minus
214 }
215
216 // FmtNumber returns 'num' with digits/precision of 'v' for 'mn' and handles both Whole and Real numbers based on 'v'
217 func (mn *mn) FmtNumber(num float64, v uint64) string {
218
219         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
220         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
221         count := 0
222         inWhole := v == 0
223         b := make([]byte, 0, l)
224
225         for i := len(s) - 1; i >= 0; i-- {
226
227                 if s[i] == '.' {
228                         b = append(b, mn.decimal[0])
229                         inWhole = true
230                         continue
231                 }
232
233                 if inWhole {
234                         if count == 3 {
235                                 b = append(b, mn.group[0])
236                                 count = 1
237                         } else {
238                                 count++
239                         }
240                 }
241
242                 b = append(b, s[i])
243         }
244
245         if num < 0 {
246                 b = append(b, mn.minus[0])
247         }
248
249         // reverse
250         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
251                 b[i], b[j] = b[j], b[i]
252         }
253
254         return string(b)
255 }
256
257 // FmtPercent returns 'num' with digits/precision of 'v' for 'mn' and handles both Whole and Real numbers based on 'v'
258 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
259 func (mn *mn) FmtPercent(num float64, v uint64) string {
260         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
261         l := len(s) + 3
262         b := make([]byte, 0, l)
263
264         for i := len(s) - 1; i >= 0; i-- {
265
266                 if s[i] == '.' {
267                         b = append(b, mn.decimal[0])
268                         continue
269                 }
270
271                 b = append(b, s[i])
272         }
273
274         if num < 0 {
275                 b = append(b, mn.minus[0])
276         }
277
278         // reverse
279         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
280                 b[i], b[j] = b[j], b[i]
281         }
282
283         b = append(b, mn.percent...)
284
285         return string(b)
286 }
287
288 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'mn'
289 func (mn *mn) FmtCurrency(num float64, v uint64, currency currency.Type) string {
290
291         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
292         symbol := mn.currencies[currency]
293         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
294         count := 0
295         inWhole := v == 0
296         b := make([]byte, 0, l)
297
298         for i := len(s) - 1; i >= 0; i-- {
299
300                 if s[i] == '.' {
301                         b = append(b, mn.decimal[0])
302                         inWhole = true
303                         continue
304                 }
305
306                 if inWhole {
307                         if count == 3 {
308                                 b = append(b, mn.group[0])
309                                 count = 1
310                         } else {
311                                 count++
312                         }
313                 }
314
315                 b = append(b, s[i])
316         }
317
318         for j := len(symbol) - 1; j >= 0; j-- {
319                 b = append(b, symbol[j])
320         }
321
322         for j := len(mn.currencyPositivePrefix) - 1; j >= 0; j-- {
323                 b = append(b, mn.currencyPositivePrefix[j])
324         }
325
326         if num < 0 {
327                 b = append(b, mn.minus[0])
328         }
329
330         // reverse
331         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
332                 b[i], b[j] = b[j], b[i]
333         }
334
335         if int(v) < 2 {
336
337                 if v == 0 {
338                         b = append(b, mn.decimal...)
339                 }
340
341                 for i := 0; i < 2-int(v); i++ {
342                         b = append(b, '0')
343                 }
344         }
345
346         return string(b)
347 }
348
349 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'mn'
350 // in accounting notation.
351 func (mn *mn) FmtAccounting(num float64, v uint64, currency currency.Type) string {
352
353         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
354         symbol := mn.currencies[currency]
355         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
356         count := 0
357         inWhole := v == 0
358         b := make([]byte, 0, l)
359
360         for i := len(s) - 1; i >= 0; i-- {
361
362                 if s[i] == '.' {
363                         b = append(b, mn.decimal[0])
364                         inWhole = true
365                         continue
366                 }
367
368                 if inWhole {
369                         if count == 3 {
370                                 b = append(b, mn.group[0])
371                                 count = 1
372                         } else {
373                                 count++
374                         }
375                 }
376
377                 b = append(b, s[i])
378         }
379
380         if num < 0 {
381
382                 for j := len(symbol) - 1; j >= 0; j-- {
383                         b = append(b, symbol[j])
384                 }
385
386                 for j := len(mn.currencyNegativePrefix) - 1; j >= 0; j-- {
387                         b = append(b, mn.currencyNegativePrefix[j])
388                 }
389
390                 b = append(b, mn.minus[0])
391
392         } else {
393
394                 for j := len(symbol) - 1; j >= 0; j-- {
395                         b = append(b, symbol[j])
396                 }
397
398                 for j := len(mn.currencyPositivePrefix) - 1; j >= 0; j-- {
399                         b = append(b, mn.currencyPositivePrefix[j])
400                 }
401
402         }
403
404         // reverse
405         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
406                 b[i], b[j] = b[j], b[i]
407         }
408
409         if int(v) < 2 {
410
411                 if v == 0 {
412                         b = append(b, mn.decimal...)
413                 }
414
415                 for i := 0; i < 2-int(v); i++ {
416                         b = append(b, '0')
417                 }
418         }
419
420         return string(b)
421 }
422
423 // FmtDateShort returns the short date representation of 't' for 'mn'
424 func (mn *mn) FmtDateShort(t time.Time) string {
425
426         b := make([]byte, 0, 32)
427
428         if t.Year() > 0 {
429                 b = strconv.AppendInt(b, int64(t.Year()), 10)
430         } else {
431                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
432         }
433
434         b = append(b, []byte{0x2d}...)
435
436         if t.Month() < 10 {
437                 b = append(b, '0')
438         }
439
440         b = strconv.AppendInt(b, int64(t.Month()), 10)
441
442         b = append(b, []byte{0x2d}...)
443
444         if t.Day() < 10 {
445                 b = append(b, '0')
446         }
447
448         b = strconv.AppendInt(b, int64(t.Day()), 10)
449
450         return string(b)
451 }
452
453 // FmtDateMedium returns the medium date representation of 't' for 'mn'
454 func (mn *mn) FmtDateMedium(t time.Time) string {
455
456         b := make([]byte, 0, 32)
457
458         if t.Year() > 0 {
459                 b = strconv.AppendInt(b, int64(t.Year()), 10)
460         } else {
461                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
462         }
463
464         b = append(b, []byte{0x20}...)
465         b = append(b, mn.monthsAbbreviated[t.Month()]...)
466         b = append(b, []byte{0x20}...)
467         b = strconv.AppendInt(b, int64(t.Day()), 10)
468
469         return string(b)
470 }
471
472 // FmtDateLong returns the long date representation of 't' for 'mn'
473 func (mn *mn) FmtDateLong(t time.Time) string {
474
475         b := make([]byte, 0, 32)
476
477         if t.Year() > 0 {
478                 b = strconv.AppendInt(b, int64(t.Year()), 10)
479         } else {
480                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
481         }
482
483         b = append(b, []byte{0xd0, 0xbe, 0xd0, 0xbd, 0xd1, 0x8b}...)
484         b = append(b, []byte{0x20}...)
485         b = append(b, mn.monthsWide[t.Month()]...)
486         b = append(b, []byte{0xd1, 0x81, 0xd0, 0xb0, 0xd1, 0x80, 0xd1, 0x8b, 0xd0, 0xbd}...)
487         b = append(b, []byte{0x20}...)
488         b = strconv.AppendInt(b, int64(t.Day()), 10)
489         b = append(b, []byte{0xd3, 0xa9, 0xd0, 0xb4, 0xd3, 0xa9, 0xd1, 0x80}...)
490
491         return string(b)
492 }
493
494 // FmtDateFull returns the full date representation of 't' for 'mn'
495 func (mn *mn) FmtDateFull(t time.Time) string {
496
497         b := make([]byte, 0, 32)
498
499         b = append(b, mn.daysWide[t.Weekday()]...)
500         b = append(b, []byte{0x2c, 0x20}...)
501
502         if t.Year() > 0 {
503                 b = strconv.AppendInt(b, int64(t.Year()), 10)
504         } else {
505                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
506         }
507
508         b = append(b, []byte{0x20, 0xd0, 0xbe, 0xd0, 0xbd, 0xd1, 0x8b}...)
509         b = append(b, []byte{0x20}...)
510
511         if t.Month() < 10 {
512                 b = append(b, '0')
513         }
514
515         b = strconv.AppendInt(b, int64(t.Month()), 10)
516
517         b = append(b, []byte{0x20, 0xd1, 0x81, 0xd0, 0xb0, 0xd1, 0x80, 0xd1, 0x8b, 0xd0, 0xbd}...)
518         b = append(b, []byte{0x20}...)
519         b = strconv.AppendInt(b, int64(t.Day()), 10)
520
521         return string(b)
522 }
523
524 // FmtTimeShort returns the short time representation of 't' for 'mn'
525 func (mn *mn) FmtTimeShort(t time.Time) string {
526
527         b := make([]byte, 0, 32)
528
529         if t.Hour() < 10 {
530                 b = append(b, '0')
531         }
532
533         b = strconv.AppendInt(b, int64(t.Hour()), 10)
534         b = append(b, mn.timeSeparator...)
535
536         if t.Minute() < 10 {
537                 b = append(b, '0')
538         }
539
540         b = strconv.AppendInt(b, int64(t.Minute()), 10)
541
542         return string(b)
543 }
544
545 // FmtTimeMedium returns the medium time representation of 't' for 'mn'
546 func (mn *mn) FmtTimeMedium(t time.Time) string {
547
548         b := make([]byte, 0, 32)
549
550         if t.Hour() < 10 {
551                 b = append(b, '0')
552         }
553
554         b = strconv.AppendInt(b, int64(t.Hour()), 10)
555         b = append(b, mn.timeSeparator...)
556
557         if t.Minute() < 10 {
558                 b = append(b, '0')
559         }
560
561         b = strconv.AppendInt(b, int64(t.Minute()), 10)
562         b = append(b, mn.timeSeparator...)
563
564         if t.Second() < 10 {
565                 b = append(b, '0')
566         }
567
568         b = strconv.AppendInt(b, int64(t.Second()), 10)
569
570         return string(b)
571 }
572
573 // FmtTimeLong returns the long time representation of 't' for 'mn'
574 func (mn *mn) FmtTimeLong(t time.Time) string {
575
576         b := make([]byte, 0, 32)
577
578         if t.Hour() < 10 {
579                 b = append(b, '0')
580         }
581
582         b = strconv.AppendInt(b, int64(t.Hour()), 10)
583         b = append(b, mn.timeSeparator...)
584
585         if t.Minute() < 10 {
586                 b = append(b, '0')
587         }
588
589         b = strconv.AppendInt(b, int64(t.Minute()), 10)
590         b = append(b, mn.timeSeparator...)
591
592         if t.Second() < 10 {
593                 b = append(b, '0')
594         }
595
596         b = strconv.AppendInt(b, int64(t.Second()), 10)
597         b = append(b, []byte{0x20}...)
598
599         tz, _ := t.Zone()
600         b = append(b, tz...)
601
602         return string(b)
603 }
604
605 // FmtTimeFull returns the full time representation of 't' for 'mn'
606 func (mn *mn) FmtTimeFull(t time.Time) string {
607
608         b := make([]byte, 0, 32)
609
610         if t.Hour() < 10 {
611                 b = append(b, '0')
612         }
613
614         b = strconv.AppendInt(b, int64(t.Hour()), 10)
615         b = append(b, mn.timeSeparator...)
616
617         if t.Minute() < 10 {
618                 b = append(b, '0')
619         }
620
621         b = strconv.AppendInt(b, int64(t.Minute()), 10)
622         b = append(b, mn.timeSeparator...)
623
624         if t.Second() < 10 {
625                 b = append(b, '0')
626         }
627
628         b = strconv.AppendInt(b, int64(t.Second()), 10)
629         b = append(b, []byte{0x20}...)
630
631         tz, _ := t.Zone()
632
633         if btz, ok := mn.timezones[tz]; ok {
634                 b = append(b, btz...)
635         } else {
636                 b = append(b, tz...)
637         }
638
639         return string(b)
640 }