OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-playground / locales / as_IN / as_IN.go
1 package as_IN
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 as_IN 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 'as_IN' locale
45 func New() locales.Translator {
46         return &as_IN{
47                 locale:                 "as_IN",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{2, 3, 4, 5, 6},
50                 pluralsRange:           nil,
51                 timeSeparator:          ".",
52                 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", "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", "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", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "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"},
53                 currencyPositivePrefix: " ",
54                 currencyNegativePrefix: " ",
55                 monthsAbbreviated:      []string{"", "জানু", "ফেব্ৰু", "মাৰ্চ", "এপ্ৰিল", "মে", "জুন", "জুলাই", "আগ", "সেপ্ট", "অক্টো", "নভে", "ডিসে"},
56                 monthsWide:             []string{"", "জানুৱাৰী", "ফেব্ৰুৱাৰী", "মাৰ্চ", "এপ্ৰিল", "মে", "জুন", "জুলাই", "আগষ্ট", "ছেপ্তেম্বৰ", "অক্টোবৰ", "নৱেম্বৰ", "ডিচেম্বৰ"},
57                 daysAbbreviated:        []string{"ৰবি", "সোম", "মঙ্গল", "বুধ", "বৃহষ্পতি", "শুক্ৰ", "শনি"},
58                 daysWide:               []string{"দেওবাৰ", "সোমবাৰ", "মঙ্গলবাৰ", "বুধবাৰ", "বৃহষ্পতিবাৰ", "শুক্ৰবাৰ", "শনিবাৰ"},
59                 periodsAbbreviated:     []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
60                 periodsWide:            []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
61                 timezones:              map[string]string{"UYT": "UYT", "HAST": "HAST", "VET": "VET", "AKDT": "AKDT", "HEPMX": "HEPMX", "BT": "BT", "ACWDT": "ACWDT", "HENOMX": "HENOMX", "HNT": "HNT", "COST": "COST", "ECT": "ECT", "GMT": "GMT", "WART": "WART", "WARST": "WARST", "∅∅∅": "∅∅∅", "HEOG": "HEOG", "GFT": "GFT", "AWST": "AWST", "EAT": "EAT", "WAST": "WAST", "GYT": "GYT", "AKST": "AKST", "ACDT": "ACDT", "HKST": "HKST", "COT": "COT", "HNPMX": "HNPMX", "UYST": "UYST", "NZST": "NZST", "ADT": "ADT", "HKT": "HKT", "HNPM": "HNPM", "NZDT": "NZDT", "LHDT": "LHDT", "AST": "AST", "HNOG": "HNOG", "CHAST": "CHAST", "AEST": "AEST", "EDT": "EDT", "WESZ": "WESZ", "HEPM": "HEPM", "MEZ": "MEZ", "CHADT": "CHADT", "OESZ": "OESZ", "MDT": "MDT", "WAT": "WAT", "HNEG": "HNEG", "PDT": "PDT", "WEZ": "WEZ", "ChST": "ChST", "LHST": "LHST", "IST": "ভাৰতীয় সময়", "ART": "ART", "CLT": "CLT", "ACST": "ACST", "HADT": "HADT", "HNNOMX": "HNNOMX", "OEZ": "OEZ", "EST": "EST", "CST": "CST", "SRT": "SRT", "BOT": "BOT", "CDT": "CDT", "ACWST": "ACWST", "WITA": "WITA", "AEDT": "AEDT", "CLST": "CLST", "CAT": "CAT", "HECU": "HECU", "JST": "JST", "JDT": "JDT", "MESZ": "MESZ", "MST": "MST", "HAT": "HAT", "WIB": "WIB", "HNCU": "HNCU", "AWDT": "AWDT", "TMT": "TMT", "TMST": "TMST", "ARST": "ARST", "SAST": "SAST", "SGT": "SGT", "PST": "PST", "MYT": "MYT", "HEEG": "HEEG", "WIT": "WIT"},
62         }
63 }
64
65 // Locale returns the current translators string locale
66 func (as *as_IN) Locale() string {
67         return as.locale
68 }
69
70 // PluralsCardinal returns the list of cardinal plural rules associated with 'as_IN'
71 func (as *as_IN) PluralsCardinal() []locales.PluralRule {
72         return as.pluralsCardinal
73 }
74
75 // PluralsOrdinal returns the list of ordinal plural rules associated with 'as_IN'
76 func (as *as_IN) PluralsOrdinal() []locales.PluralRule {
77         return as.pluralsOrdinal
78 }
79
80 // PluralsRange returns the list of range plural rules associated with 'as_IN'
81 func (as *as_IN) PluralsRange() []locales.PluralRule {
82         return as.pluralsRange
83 }
84
85 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'as_IN'
86 func (as *as_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
87
88         n := math.Abs(num)
89         i := int64(n)
90
91         if (i == 0) || (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 'as_IN'
99 func (as *as_IN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102
103         if n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 {
104                 return locales.PluralRuleOne
105         } else if n == 2 || n == 3 {
106                 return locales.PluralRuleTwo
107         } else if n == 4 {
108                 return locales.PluralRuleFew
109         } else if n == 6 {
110                 return locales.PluralRuleMany
111         }
112
113         return locales.PluralRuleOther
114 }
115
116 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'as_IN'
117 func (as *as_IN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
118         return locales.PluralRuleUnknown
119 }
120
121 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
122 func (as *as_IN) MonthAbbreviated(month time.Month) string {
123         return as.monthsAbbreviated[month]
124 }
125
126 // MonthsAbbreviated returns the locales abbreviated months
127 func (as *as_IN) MonthsAbbreviated() []string {
128         return as.monthsAbbreviated[1:]
129 }
130
131 // MonthNarrow returns the locales narrow month given the 'month' provided
132 func (as *as_IN) MonthNarrow(month time.Month) string {
133         return as.monthsNarrow[month]
134 }
135
136 // MonthsNarrow returns the locales narrow months
137 func (as *as_IN) MonthsNarrow() []string {
138         return nil
139 }
140
141 // MonthWide returns the locales wide month given the 'month' provided
142 func (as *as_IN) MonthWide(month time.Month) string {
143         return as.monthsWide[month]
144 }
145
146 // MonthsWide returns the locales wide months
147 func (as *as_IN) MonthsWide() []string {
148         return as.monthsWide[1:]
149 }
150
151 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
152 func (as *as_IN) WeekdayAbbreviated(weekday time.Weekday) string {
153         return as.daysAbbreviated[weekday]
154 }
155
156 // WeekdaysAbbreviated returns the locales abbreviated weekdays
157 func (as *as_IN) WeekdaysAbbreviated() []string {
158         return as.daysAbbreviated
159 }
160
161 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
162 func (as *as_IN) WeekdayNarrow(weekday time.Weekday) string {
163         return as.daysNarrow[weekday]
164 }
165
166 // WeekdaysNarrow returns the locales narrow weekdays
167 func (as *as_IN) WeekdaysNarrow() []string {
168         return as.daysNarrow
169 }
170
171 // WeekdayShort returns the locales short weekday given the 'weekday' provided
172 func (as *as_IN) WeekdayShort(weekday time.Weekday) string {
173         return as.daysShort[weekday]
174 }
175
176 // WeekdaysShort returns the locales short weekdays
177 func (as *as_IN) WeekdaysShort() []string {
178         return as.daysShort
179 }
180
181 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
182 func (as *as_IN) WeekdayWide(weekday time.Weekday) string {
183         return as.daysWide[weekday]
184 }
185
186 // WeekdaysWide returns the locales wide weekdays
187 func (as *as_IN) WeekdaysWide() []string {
188         return as.daysWide
189 }
190
191 // Decimal returns the decimal point of number
192 func (as *as_IN) Decimal() string {
193         return as.decimal
194 }
195
196 // Group returns the group of number
197 func (as *as_IN) Group() string {
198         return as.group
199 }
200
201 // Group returns the minus sign of number
202 func (as *as_IN) Minus() string {
203         return as.minus
204 }
205
206 // FmtNumber returns 'num' with digits/precision of 'v' for 'as_IN' and handles both Whole and Real numbers based on 'v'
207 func (as *as_IN) FmtNumber(num float64, v uint64) string {
208
209         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
210         l := len(s) + 0
211         count := 0
212         inWhole := v == 0
213         inSecondary := false
214         groupThreshold := 3
215
216         b := make([]byte, 0, l)
217
218         for i := len(s) - 1; i >= 0; i-- {
219
220                 if s[i] == '.' {
221                         b = append(b, as.decimal[0])
222                         inWhole = true
223                         continue
224                 }
225
226                 if inWhole {
227
228                         if count == groupThreshold {
229                                 b = append(b, as.group[0])
230                                 count = 1
231
232                                 if !inSecondary {
233                                         inSecondary = true
234                                         groupThreshold = 2
235                                 }
236                         } else {
237                                 count++
238                         }
239                 }
240
241                 b = append(b, s[i])
242         }
243
244         if num < 0 {
245                 b = append(b, as.minus[0])
246         }
247
248         // reverse
249         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
250                 b[i], b[j] = b[j], b[i]
251         }
252
253         return string(b)
254 }
255
256 // FmtPercent returns 'num' with digits/precision of 'v' for 'as_IN' and handles both Whole and Real numbers based on 'v'
257 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
258 func (as *as_IN) FmtPercent(num float64, v uint64) string {
259         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
260         l := len(s) + 0
261         b := make([]byte, 0, l)
262
263         for i := len(s) - 1; i >= 0; i-- {
264
265                 if s[i] == '.' {
266                         b = append(b, as.decimal[0])
267                         continue
268                 }
269
270                 b = append(b, s[i])
271         }
272
273         if num < 0 {
274                 b = append(b, as.minus[0])
275         }
276
277         // reverse
278         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
279                 b[i], b[j] = b[j], b[i]
280         }
281
282         b = append(b, as.percent...)
283
284         return string(b)
285 }
286
287 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'as_IN'
288 func (as *as_IN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
289
290         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
291         symbol := as.currencies[currency]
292         l := len(s) + len(symbol) + 2
293         count := 0
294         inWhole := v == 0
295         inSecondary := false
296         groupThreshold := 3
297
298         b := make([]byte, 0, l)
299
300         for i := len(s) - 1; i >= 0; i-- {
301
302                 if s[i] == '.' {
303                         b = append(b, as.decimal[0])
304                         inWhole = true
305                         continue
306                 }
307
308                 if inWhole {
309
310                         if count == groupThreshold {
311                                 b = append(b, as.group[0])
312                                 count = 1
313
314                                 if !inSecondary {
315                                         inSecondary = true
316                                         groupThreshold = 2
317                                 }
318                         } else {
319                                 count++
320                         }
321                 }
322
323                 b = append(b, s[i])
324         }
325
326         for j := len(symbol) - 1; j >= 0; j-- {
327                 b = append(b, symbol[j])
328         }
329
330         for j := len(as.currencyPositivePrefix) - 1; j >= 0; j-- {
331                 b = append(b, as.currencyPositivePrefix[j])
332         }
333
334         if num < 0 {
335                 b = append(b, as.minus[0])
336         }
337
338         // reverse
339         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
340                 b[i], b[j] = b[j], b[i]
341         }
342
343         if int(v) < 2 {
344
345                 if v == 0 {
346                         b = append(b, as.decimal...)
347                 }
348
349                 for i := 0; i < 2-int(v); i++ {
350                         b = append(b, '0')
351                 }
352         }
353
354         return string(b)
355 }
356
357 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'as_IN'
358 // in accounting notation.
359 func (as *as_IN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
360
361         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
362         symbol := as.currencies[currency]
363         l := len(s) + len(symbol) + 2
364         count := 0
365         inWhole := v == 0
366         inSecondary := false
367         groupThreshold := 3
368
369         b := make([]byte, 0, l)
370
371         for i := len(s) - 1; i >= 0; i-- {
372
373                 if s[i] == '.' {
374                         b = append(b, as.decimal[0])
375                         inWhole = true
376                         continue
377                 }
378
379                 if inWhole {
380
381                         if count == groupThreshold {
382                                 b = append(b, as.group[0])
383                                 count = 1
384
385                                 if !inSecondary {
386                                         inSecondary = true
387                                         groupThreshold = 2
388                                 }
389                         } else {
390                                 count++
391                         }
392                 }
393
394                 b = append(b, s[i])
395         }
396
397         if num < 0 {
398
399                 for j := len(symbol) - 1; j >= 0; j-- {
400                         b = append(b, symbol[j])
401                 }
402
403                 for j := len(as.currencyNegativePrefix) - 1; j >= 0; j-- {
404                         b = append(b, as.currencyNegativePrefix[j])
405                 }
406
407                 b = append(b, as.minus[0])
408
409         } else {
410
411                 for j := len(symbol) - 1; j >= 0; j-- {
412                         b = append(b, symbol[j])
413                 }
414
415                 for j := len(as.currencyPositivePrefix) - 1; j >= 0; j-- {
416                         b = append(b, as.currencyPositivePrefix[j])
417                 }
418
419         }
420
421         // reverse
422         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
423                 b[i], b[j] = b[j], b[i]
424         }
425
426         if int(v) < 2 {
427
428                 if v == 0 {
429                         b = append(b, as.decimal...)
430                 }
431
432                 for i := 0; i < 2-int(v); i++ {
433                         b = append(b, '0')
434                 }
435         }
436
437         return string(b)
438 }
439
440 // FmtDateShort returns the short date representation of 't' for 'as_IN'
441 func (as *as_IN) FmtDateShort(t time.Time) string {
442
443         b := make([]byte, 0, 32)
444
445         b = strconv.AppendInt(b, int64(t.Day()), 10)
446         b = append(b, []byte{0x2d}...)
447         b = strconv.AppendInt(b, int64(t.Month()), 10)
448         b = append(b, []byte{0x2d}...)
449
450         if t.Year() > 0 {
451                 b = strconv.AppendInt(b, int64(t.Year()), 10)
452         } else {
453                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
454         }
455
456         return string(b)
457 }
458
459 // FmtDateMedium returns the medium date representation of 't' for 'as_IN'
460 func (as *as_IN) FmtDateMedium(t time.Time) string {
461
462         b := make([]byte, 0, 32)
463
464         if t.Day() < 10 {
465                 b = append(b, '0')
466         }
467
468         b = strconv.AppendInt(b, int64(t.Day()), 10)
469         b = append(b, []byte{0x2d}...)
470
471         if t.Month() < 10 {
472                 b = append(b, '0')
473         }
474
475         b = strconv.AppendInt(b, int64(t.Month()), 10)
476
477         b = append(b, []byte{0x2d}...)
478
479         if t.Year() > 0 {
480                 b = strconv.AppendInt(b, int64(t.Year()), 10)
481         } else {
482                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
483         }
484
485         return string(b)
486 }
487
488 // FmtDateLong returns the long date representation of 't' for 'as_IN'
489 func (as *as_IN) FmtDateLong(t time.Time) string {
490
491         b := make([]byte, 0, 32)
492
493         b = strconv.AppendInt(b, int64(t.Day()), 10)
494         b = append(b, []byte{0x20}...)
495         b = append(b, as.monthsWide[t.Month()]...)
496         b = append(b, []byte{0x2c, 0x20}...)
497
498         if t.Year() > 0 {
499                 b = strconv.AppendInt(b, int64(t.Year()), 10)
500         } else {
501                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
502         }
503
504         return string(b)
505 }
506
507 // FmtDateFull returns the full date representation of 't' for 'as_IN'
508 func (as *as_IN) FmtDateFull(t time.Time) string {
509
510         b := make([]byte, 0, 32)
511
512         b = append(b, as.daysWide[t.Weekday()]...)
513         b = append(b, []byte{0x2c, 0x20}...)
514         b = strconv.AppendInt(b, int64(t.Day()), 10)
515         b = append(b, []byte{0x20}...)
516         b = append(b, as.monthsWide[t.Month()]...)
517         b = append(b, []byte{0x2c, 0x20}...)
518
519         if t.Year() > 0 {
520                 b = strconv.AppendInt(b, int64(t.Year()), 10)
521         } else {
522                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
523         }
524
525         return string(b)
526 }
527
528 // FmtTimeShort returns the short time representation of 't' for 'as_IN'
529 func (as *as_IN) FmtTimeShort(t time.Time) string {
530
531         b := make([]byte, 0, 32)
532
533         h := t.Hour()
534
535         if h > 12 {
536                 h -= 12
537         }
538
539         b = strconv.AppendInt(b, int64(h), 10)
540         b = append(b, []byte{0x2e}...)
541
542         if t.Minute() < 10 {
543                 b = append(b, '0')
544         }
545
546         b = strconv.AppendInt(b, int64(t.Minute()), 10)
547         b = append(b, []byte{0x2e, 0x20}...)
548
549         if t.Hour() < 12 {
550                 b = append(b, as.periodsAbbreviated[0]...)
551         } else {
552                 b = append(b, as.periodsAbbreviated[1]...)
553         }
554
555         return string(b)
556 }
557
558 // FmtTimeMedium returns the medium time representation of 't' for 'as_IN'
559 func (as *as_IN) FmtTimeMedium(t time.Time) string {
560
561         b := make([]byte, 0, 32)
562
563         h := t.Hour()
564
565         if h > 12 {
566                 h -= 12
567         }
568
569         b = strconv.AppendInt(b, int64(h), 10)
570         b = append(b, []byte{0x2e}...)
571
572         if t.Minute() < 10 {
573                 b = append(b, '0')
574         }
575
576         b = strconv.AppendInt(b, int64(t.Minute()), 10)
577         b = append(b, []byte{0x2e}...)
578
579         if t.Second() < 10 {
580                 b = append(b, '0')
581         }
582
583         b = strconv.AppendInt(b, int64(t.Second()), 10)
584         b = append(b, []byte{0x20}...)
585
586         if t.Hour() < 12 {
587                 b = append(b, as.periodsAbbreviated[0]...)
588         } else {
589                 b = append(b, as.periodsAbbreviated[1]...)
590         }
591
592         return string(b)
593 }
594
595 // FmtTimeLong returns the long time representation of 't' for 'as_IN'
596 func (as *as_IN) FmtTimeLong(t time.Time) string {
597
598         b := make([]byte, 0, 32)
599
600         h := t.Hour()
601
602         if h > 12 {
603                 h -= 12
604         }
605
606         b = strconv.AppendInt(b, int64(h), 10)
607         b = append(b, []byte{0x2e}...)
608
609         if t.Minute() < 10 {
610                 b = append(b, '0')
611         }
612
613         b = strconv.AppendInt(b, int64(t.Minute()), 10)
614         b = append(b, []byte{0x2e}...)
615
616         if t.Second() < 10 {
617                 b = append(b, '0')
618         }
619
620         b = strconv.AppendInt(b, int64(t.Second()), 10)
621         b = append(b, []byte{0x20}...)
622
623         if t.Hour() < 12 {
624                 b = append(b, as.periodsAbbreviated[0]...)
625         } else {
626                 b = append(b, as.periodsAbbreviated[1]...)
627         }
628
629         b = append(b, []byte{0x20}...)
630
631         tz, _ := t.Zone()
632         b = append(b, tz...)
633
634         return string(b)
635 }
636
637 // FmtTimeFull returns the full time representation of 't' for 'as_IN'
638 func (as *as_IN) FmtTimeFull(t time.Time) string {
639
640         b := make([]byte, 0, 32)
641
642         h := t.Hour()
643
644         if h > 12 {
645                 h -= 12
646         }
647
648         b = strconv.AppendInt(b, int64(h), 10)
649         b = append(b, []byte{0x2e}...)
650
651         if t.Minute() < 10 {
652                 b = append(b, '0')
653         }
654
655         b = strconv.AppendInt(b, int64(t.Minute()), 10)
656         b = append(b, []byte{0x2e}...)
657
658         if t.Second() < 10 {
659                 b = append(b, '0')
660         }
661
662         b = strconv.AppendInt(b, int64(t.Second()), 10)
663         b = append(b, []byte{0x20}...)
664
665         if t.Hour() < 12 {
666                 b = append(b, as.periodsAbbreviated[0]...)
667         } else {
668                 b = append(b, as.periodsAbbreviated[1]...)
669         }
670
671         b = append(b, []byte{0x20}...)
672
673         tz, _ := t.Zone()
674
675         if btz, ok := as.timezones[tz]; ok {
676                 b = append(b, btz...)
677         } else {
678                 b = append(b, tz...)
679         }
680
681         return string(b)
682 }