OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-playground / locales / fa / fa.go
1 package fa
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 fa 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 'fa' locale
45 func New() locales.Translator {
46         return &fa{
47                 locale:                 "fa",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{6},
50                 pluralsRange:           []locales.PluralRule{6},
51                 decimal:                "٫",
52                 group:                  "٬",
53                 minus:                  "‎−",
54                 percent:                "‎٪",
55                 perMille:               "؉",
56                 timeSeparator:          ":",
57                 inifinity:              "∞",
58                 currencies:             []string{"ADP", "AED", "AFA", "؋", "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", "ریال", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "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", "MNT", "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{"", "ژانویهٔ", "فوریهٔ", "مارس", "آوریل", "مهٔ", "ژوئن", "ژوئیهٔ", "اوت", "سپتامبر", "اکتبر", "نوامبر", "دسامبر"},
62                 monthsNarrow:           []string{"", "ژ", "ف", "م", "آ", "م", "ژ", "ژ", "ا", "س", "ا", "ن", "د"},
63                 monthsWide:             []string{"", "ژانویهٔ", "فوریهٔ", "مارس", "آوریل", "مهٔ", "ژوئن", "ژوئیهٔ", "اوت", "سپتامبر", "اکتبر", "نوامبر", "دسامبر"},
64                 daysAbbreviated:        []string{"یکشنبه", "دوشنبه", "سه\u200cشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"},
65                 daysNarrow:             []string{"ی", "د", "س", "چ", "پ", "ج", "ش"},
66                 daysShort:              []string{"۱ش", "۲ش", "۳ش", "۴ش", "۵ش", "ج", "ش"},
67                 daysWide:               []string{"یکشنبه", "دوشنبه", "سه\u200cشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"},
68                 periodsAbbreviated:     []string{"ق.ظ.", "ب.ظ."},
69                 periodsNarrow:          []string{"ق", "ب"},
70                 periodsWide:            []string{"قبل\u200cازظهر", "بعدازظهر"},
71                 erasAbbreviated:        []string{"ق.م.", "م."},
72                 erasNarrow:             []string{"ق", "م"},
73                 erasWide:               []string{"قبل از میلاد", "میلادی"},
74                 timezones:              map[string]string{"JST": "وقت عادی ژاپن", "AEST": "وقت عادی شرق استرالیا", "HNPMX": "وقت عادی شرق مکزیک", "MYT": "وقت مالزی", "VET": "وقت ونزوئلا", "JDT": "وقت تابستانی ژاپن", "ART": "وقت عادی آرژانتین", "WAT": "وقت عادی غرب افریقا", "HKST": "وقت تابستانی هنگ\u200cکنگ", "UYT": "وقت عادی اروگوئه", "NZDT": "وقت تابستانی زلاند نو", "OEZ": "وقت عادی شرق اروپا", "GFT": "وقت گویان فرانسه", "AKST": "وقت عادی آلاسکا", "SGT": "وقت سنگاپور", "ChST": "وقت عادی چامورو", "HNCU": "وقت عادی کوبا", "NZST": "وقت عادی زلاند نو", "CLST": "وقت تابستانی شیلی", "EDT": "وقت تابستانی شرق امریکا", "BOT": "وقت بولیوی", "AWDT": "وقت تابستانی غرب استرالیا", "LHST": "وقت عادی لردهو", "WARST": "وقت تابستانی غرب آرژانتین", "EST": "وقت عادی شرق امریکا", "GYT": "وقت گویان", "HEPM": "وقت تابستانی سنت\u200cپیر و میکلون", "SRT": "وقت سورینام", "WIT": "وقت شرق اندونزی", "WITA": "وقت مرکز اندونزی", "CST": "وقت عادی مرکز امریکا", "ACWDT": "وقت تابستانی مرکز-غرب استرالیا", "CHAST": "وقت عادی چت\u200cهام", "MEZ": "وقت عادی مرکز اروپا", "HAST": "وقت عادی هاوایی‐الوشن", "OESZ": "وقت تابستانی شرق اروپا", "CLT": "وقت عادی شیلی", "COT": "وقت عادی کلمبیا", "COST": "وقت تابستانی کلمبیا", "WESZ": "وقت تابستانی غرب اروپا", "ARST": "وقت تابستانی آرژانتین", "HNEG": "وقت عادی شرق گرینلند", "HKT": "وقت عادی هنگ\u200cکنگ", "HENOMX": "وقت تابستانی شمال غرب مکزیک", "HEOG": "وقت تابستانی غرب گرینلند", "WAST": "وقت تابستانی غرب افریقا", "AKDT": "وقت تابستانی آلاسکا", "ACDT": "وقت تابستانی مرکز استرالیا", "GMT": "وقت گرینویچ", "PST": "وقت عادی غرب امریکا", "MST": "وقت عادی کوهستانی امریکا", "AEDT": "وقت تابستانی شرق استرالیا", "WEZ": "وقت عادی غرب اروپا", "HEPMX": "وقت تابستانی شرق مکزیک", "CHADT": "وقت تابستانی چت\u200cهام", "HNOG": "وقت عادی غرب گرینلند", "SAST": "وقت عادی جنوب افریقا", "LHDT": "وقت تابستانی لردهو", "HNNOMX": "وقت عادی شمال غرب مکزیک", "CAT": "وقت مرکز افریقا", "CDT": "وقت تابستانی مرکز امریکا", "MESZ": "وقت تابستانی مرکز اروپا", "HNT": "وقت عادی نیوفاندلند", "HAT": "وقت تابستانی نیوفاندلند", "ACST": "وقت عادی مرکز استرالیا", "HNPM": "وقت عادی سنت\u200cپیر و میکلون", "ACWST": "وقت عادی مرکز-غرب استرالیا", "UYST": "وقت تابستانی اروگوئه", "TMT": "وقت عادی ترکمنستان", "TMST": "وقت تابستانی ترکمنستان", "WART": "وقت عادی غرب آرژانتین", "AST": "وقت عادی آتلانتیک", "HEEG": "وقت تابستانی شرق گرینلند", "PDT": "وقت تابستانی غرب امریکا", "MDT": "وقت تابستانی کوهستانی امریکا", "∅∅∅": "وقت تابستانی آزور", "ADT": "وقت تابستانی آتلانتیک", "ECT": "وقت اکوادور", "WIB": "وقت غرب اندونزی", "HECU": "وقت تابستانی کوبا", "BT": "وقت بوتان", "HADT": "وقت تابستانی هاوایی‐الوشن", "IST": "وقت هند", "EAT": "وقت شرق افریقا", "AWST": "وقت عادی غرب استرالیا"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (fa *fa) Locale() string {
80         return fa.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'fa'
84 func (fa *fa) PluralsCardinal() []locales.PluralRule {
85         return fa.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'fa'
89 func (fa *fa) PluralsOrdinal() []locales.PluralRule {
90         return fa.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'fa'
94 func (fa *fa) PluralsRange() []locales.PluralRule {
95         return fa.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'fa'
99 func (fa *fa) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102         i := int64(n)
103
104         if (i == 0) || (n == 1) {
105                 return locales.PluralRuleOne
106         }
107
108         return locales.PluralRuleOther
109 }
110
111 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'fa'
112 func (fa *fa) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
113         return locales.PluralRuleOther
114 }
115
116 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'fa'
117 func (fa *fa) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
118         return locales.PluralRuleOther
119 }
120
121 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
122 func (fa *fa) MonthAbbreviated(month time.Month) string {
123         return fa.monthsAbbreviated[month]
124 }
125
126 // MonthsAbbreviated returns the locales abbreviated months
127 func (fa *fa) MonthsAbbreviated() []string {
128         return fa.monthsAbbreviated[1:]
129 }
130
131 // MonthNarrow returns the locales narrow month given the 'month' provided
132 func (fa *fa) MonthNarrow(month time.Month) string {
133         return fa.monthsNarrow[month]
134 }
135
136 // MonthsNarrow returns the locales narrow months
137 func (fa *fa) MonthsNarrow() []string {
138         return fa.monthsNarrow[1:]
139 }
140
141 // MonthWide returns the locales wide month given the 'month' provided
142 func (fa *fa) MonthWide(month time.Month) string {
143         return fa.monthsWide[month]
144 }
145
146 // MonthsWide returns the locales wide months
147 func (fa *fa) MonthsWide() []string {
148         return fa.monthsWide[1:]
149 }
150
151 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
152 func (fa *fa) WeekdayAbbreviated(weekday time.Weekday) string {
153         return fa.daysAbbreviated[weekday]
154 }
155
156 // WeekdaysAbbreviated returns the locales abbreviated weekdays
157 func (fa *fa) WeekdaysAbbreviated() []string {
158         return fa.daysAbbreviated
159 }
160
161 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
162 func (fa *fa) WeekdayNarrow(weekday time.Weekday) string {
163         return fa.daysNarrow[weekday]
164 }
165
166 // WeekdaysNarrow returns the locales narrow weekdays
167 func (fa *fa) WeekdaysNarrow() []string {
168         return fa.daysNarrow
169 }
170
171 // WeekdayShort returns the locales short weekday given the 'weekday' provided
172 func (fa *fa) WeekdayShort(weekday time.Weekday) string {
173         return fa.daysShort[weekday]
174 }
175
176 // WeekdaysShort returns the locales short weekdays
177 func (fa *fa) WeekdaysShort() []string {
178         return fa.daysShort
179 }
180
181 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
182 func (fa *fa) WeekdayWide(weekday time.Weekday) string {
183         return fa.daysWide[weekday]
184 }
185
186 // WeekdaysWide returns the locales wide weekdays
187 func (fa *fa) WeekdaysWide() []string {
188         return fa.daysWide
189 }
190
191 // Decimal returns the decimal point of number
192 func (fa *fa) Decimal() string {
193         return fa.decimal
194 }
195
196 // Group returns the group of number
197 func (fa *fa) Group() string {
198         return fa.group
199 }
200
201 // Group returns the minus sign of number
202 func (fa *fa) Minus() string {
203         return fa.minus
204 }
205
206 // FmtNumber returns 'num' with digits/precision of 'v' for 'fa' and handles both Whole and Real numbers based on 'v'
207 func (fa *fa) FmtNumber(num float64, v uint64) string {
208
209         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
210         l := len(s) + 8 + 2*len(s[:len(s)-int(v)-1])/3
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                         for j := len(fa.decimal) - 1; j >= 0; j-- {
219                                 b = append(b, fa.decimal[j])
220                         }
221                         inWhole = true
222                         continue
223                 }
224
225                 if inWhole {
226                         if count == 3 {
227                                 for j := len(fa.group) - 1; j >= 0; j-- {
228                                         b = append(b, fa.group[j])
229                                 }
230                                 count = 1
231                         } else {
232                                 count++
233                         }
234                 }
235
236                 b = append(b, s[i])
237         }
238
239         if num < 0 {
240                 for j := len(fa.minus) - 1; j >= 0; j-- {
241                         b = append(b, fa.minus[j])
242                 }
243         }
244
245         // reverse
246         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
247                 b[i], b[j] = b[j], b[i]
248         }
249
250         return string(b)
251 }
252
253 // FmtPercent returns 'num' with digits/precision of 'v' for 'fa' and handles both Whole and Real numbers based on 'v'
254 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
255 func (fa *fa) FmtPercent(num float64, v uint64) string {
256         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
257         l := len(s) + 13
258         b := make([]byte, 0, l)
259
260         for i := len(s) - 1; i >= 0; i-- {
261
262                 if s[i] == '.' {
263                         for j := len(fa.decimal) - 1; j >= 0; j-- {
264                                 b = append(b, fa.decimal[j])
265                         }
266                         continue
267                 }
268
269                 b = append(b, s[i])
270         }
271
272         if num < 0 {
273                 for j := len(fa.minus) - 1; j >= 0; j-- {
274                         b = append(b, fa.minus[j])
275                 }
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, fa.percent...)
284
285         return string(b)
286 }
287
288 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'fa'
289 func (fa *fa) FmtCurrency(num float64, v uint64, currency currency.Type) string {
290
291         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
292         symbol := fa.currencies[currency]
293         l := len(s) + len(symbol) + 11 + 2*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                         for j := len(fa.decimal) - 1; j >= 0; j-- {
302                                 b = append(b, fa.decimal[j])
303                         }
304                         inWhole = true
305                         continue
306                 }
307
308                 if inWhole {
309                         if count == 3 {
310                                 for j := len(fa.group) - 1; j >= 0; j-- {
311                                         b = append(b, fa.group[j])
312                                 }
313                                 count = 1
314                         } else {
315                                 count++
316                         }
317                 }
318
319                 b = append(b, s[i])
320         }
321
322         for j := len(symbol) - 1; j >= 0; j-- {
323                 b = append(b, symbol[j])
324         }
325
326         for j := len(fa.currencyPositivePrefix) - 1; j >= 0; j-- {
327                 b = append(b, fa.currencyPositivePrefix[j])
328         }
329
330         if num < 0 {
331                 for j := len(fa.minus) - 1; j >= 0; j-- {
332                         b = append(b, fa.minus[j])
333                 }
334         }
335
336         // reverse
337         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
338                 b[i], b[j] = b[j], b[i]
339         }
340
341         if int(v) < 2 {
342
343                 if v == 0 {
344                         b = append(b, fa.decimal...)
345                 }
346
347                 for i := 0; i < 2-int(v); i++ {
348                         b = append(b, '0')
349                 }
350         }
351
352         return string(b)
353 }
354
355 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'fa'
356 // in accounting notation.
357 func (fa *fa) FmtAccounting(num float64, v uint64, currency currency.Type) string {
358
359         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
360         symbol := fa.currencies[currency]
361         l := len(s) + len(symbol) + 11 + 2*len(s[:len(s)-int(v)-1])/3
362         count := 0
363         inWhole := v == 0
364         b := make([]byte, 0, l)
365
366         for i := len(s) - 1; i >= 0; i-- {
367
368                 if s[i] == '.' {
369                         for j := len(fa.decimal) - 1; j >= 0; j-- {
370                                 b = append(b, fa.decimal[j])
371                         }
372                         inWhole = true
373                         continue
374                 }
375
376                 if inWhole {
377                         if count == 3 {
378                                 for j := len(fa.group) - 1; j >= 0; j-- {
379                                         b = append(b, fa.group[j])
380                                 }
381                                 count = 1
382                         } else {
383                                 count++
384                         }
385                 }
386
387                 b = append(b, s[i])
388         }
389
390         if num < 0 {
391
392                 for j := len(symbol) - 1; j >= 0; j-- {
393                         b = append(b, symbol[j])
394                 }
395
396                 for j := len(fa.currencyNegativePrefix) - 1; j >= 0; j-- {
397                         b = append(b, fa.currencyNegativePrefix[j])
398                 }
399
400                 for j := len(fa.minus) - 1; j >= 0; j-- {
401                         b = append(b, fa.minus[j])
402                 }
403
404         } else {
405
406                 for j := len(symbol) - 1; j >= 0; j-- {
407                         b = append(b, symbol[j])
408                 }
409
410                 for j := len(fa.currencyPositivePrefix) - 1; j >= 0; j-- {
411                         b = append(b, fa.currencyPositivePrefix[j])
412                 }
413
414         }
415
416         // reverse
417         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
418                 b[i], b[j] = b[j], b[i]
419         }
420
421         if int(v) < 2 {
422
423                 if v == 0 {
424                         b = append(b, fa.decimal...)
425                 }
426
427                 for i := 0; i < 2-int(v); i++ {
428                         b = append(b, '0')
429                 }
430         }
431
432         return string(b)
433 }
434
435 // FmtDateShort returns the short date representation of 't' for 'fa'
436 func (fa *fa) FmtDateShort(t time.Time) string {
437
438         b := make([]byte, 0, 32)
439
440         if t.Year() > 0 {
441                 b = strconv.AppendInt(b, int64(t.Year()), 10)
442         } else {
443                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
444         }
445
446         b = append(b, []byte{0x2f}...)
447         b = strconv.AppendInt(b, int64(t.Month()), 10)
448         b = append(b, []byte{0x2f}...)
449         b = strconv.AppendInt(b, int64(t.Day()), 10)
450
451         return string(b)
452 }
453
454 // FmtDateMedium returns the medium date representation of 't' for 'fa'
455 func (fa *fa) FmtDateMedium(t time.Time) string {
456
457         b := make([]byte, 0, 32)
458
459         b = strconv.AppendInt(b, int64(t.Day()), 10)
460         b = append(b, []byte{0x20}...)
461         b = append(b, fa.monthsAbbreviated[t.Month()]...)
462         b = append(b, []byte{0x20}...)
463
464         if t.Year() > 0 {
465                 b = strconv.AppendInt(b, int64(t.Year()), 10)
466         } else {
467                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
468         }
469
470         return string(b)
471 }
472
473 // FmtDateLong returns the long date representation of 't' for 'fa'
474 func (fa *fa) FmtDateLong(t time.Time) string {
475
476         b := make([]byte, 0, 32)
477
478         b = strconv.AppendInt(b, int64(t.Day()), 10)
479         b = append(b, []byte{0x20}...)
480         b = append(b, fa.monthsWide[t.Month()]...)
481         b = append(b, []byte{0x20}...)
482
483         if t.Year() > 0 {
484                 b = strconv.AppendInt(b, int64(t.Year()), 10)
485         } else {
486                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
487         }
488
489         return string(b)
490 }
491
492 // FmtDateFull returns the full date representation of 't' for 'fa'
493 func (fa *fa) FmtDateFull(t time.Time) string {
494
495         b := make([]byte, 0, 32)
496
497         b = append(b, fa.daysWide[t.Weekday()]...)
498         b = append(b, []byte{0x20}...)
499         b = strconv.AppendInt(b, int64(t.Day()), 10)
500         b = append(b, []byte{0x20}...)
501         b = append(b, fa.monthsWide[t.Month()]...)
502         b = append(b, []byte{0x20}...)
503
504         if t.Year() > 0 {
505                 b = strconv.AppendInt(b, int64(t.Year()), 10)
506         } else {
507                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
508         }
509
510         return string(b)
511 }
512
513 // FmtTimeShort returns the short time representation of 't' for 'fa'
514 func (fa *fa) FmtTimeShort(t time.Time) string {
515
516         b := make([]byte, 0, 32)
517
518         b = strconv.AppendInt(b, int64(t.Hour()), 10)
519         b = append(b, fa.timeSeparator...)
520
521         if t.Minute() < 10 {
522                 b = append(b, '0')
523         }
524
525         b = strconv.AppendInt(b, int64(t.Minute()), 10)
526
527         return string(b)
528 }
529
530 // FmtTimeMedium returns the medium time representation of 't' for 'fa'
531 func (fa *fa) FmtTimeMedium(t time.Time) string {
532
533         b := make([]byte, 0, 32)
534
535         b = strconv.AppendInt(b, int64(t.Hour()), 10)
536         b = append(b, fa.timeSeparator...)
537
538         if t.Minute() < 10 {
539                 b = append(b, '0')
540         }
541
542         b = strconv.AppendInt(b, int64(t.Minute()), 10)
543         b = append(b, fa.timeSeparator...)
544
545         if t.Second() < 10 {
546                 b = append(b, '0')
547         }
548
549         b = strconv.AppendInt(b, int64(t.Second()), 10)
550
551         return string(b)
552 }
553
554 // FmtTimeLong returns the long time representation of 't' for 'fa'
555 func (fa *fa) FmtTimeLong(t time.Time) string {
556
557         b := make([]byte, 0, 32)
558
559         b = strconv.AppendInt(b, int64(t.Hour()), 10)
560         b = append(b, fa.timeSeparator...)
561
562         if t.Minute() < 10 {
563                 b = append(b, '0')
564         }
565
566         b = strconv.AppendInt(b, int64(t.Minute()), 10)
567         b = append(b, fa.timeSeparator...)
568
569         if t.Second() < 10 {
570                 b = append(b, '0')
571         }
572
573         b = strconv.AppendInt(b, int64(t.Second()), 10)
574         b = append(b, []byte{0x20, 0x28}...)
575
576         tz, _ := t.Zone()
577         b = append(b, tz...)
578
579         b = append(b, []byte{0x29}...)
580
581         return string(b)
582 }
583
584 // FmtTimeFull returns the full time representation of 't' for 'fa'
585 func (fa *fa) FmtTimeFull(t time.Time) string {
586
587         b := make([]byte, 0, 32)
588
589         b = strconv.AppendInt(b, int64(t.Hour()), 10)
590         b = append(b, fa.timeSeparator...)
591
592         if t.Minute() < 10 {
593                 b = append(b, '0')
594         }
595
596         b = strconv.AppendInt(b, int64(t.Minute()), 10)
597         b = append(b, fa.timeSeparator...)
598
599         if t.Second() < 10 {
600                 b = append(b, '0')
601         }
602
603         b = strconv.AppendInt(b, int64(t.Second()), 10)
604         b = append(b, []byte{0x20, 0x28}...)
605
606         tz, _ := t.Zone()
607
608         if btz, ok := fa.timezones[tz]; ok {
609                 b = append(b, btz...)
610         } else {
611                 b = append(b, tz...)
612         }
613
614         b = append(b, []byte{0x29}...)
615
616         return string(b)
617 }