OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / ta_MY / ta_MY.go
1 package ta_MY
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 ta_MY 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 'ta_MY' locale
45 func New() locales.Translator {
46         return &ta_MY{
47                 locale:                 "ta_MY",
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", "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", "RM", "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", "S$", "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"},
59                 currencyPositivePrefix: " ",
60                 currencyNegativePrefix: " ",
61                 monthsAbbreviated:      []string{"", "ஜன.", "பிப்.", "மார்.", "ஏப்.", "மே", "ஜூன்", "ஜூலை", "ஆக.", "செப்.", "அக்.", "நவ.", "டிச."},
62                 monthsNarrow:           []string{"", "ஜ", "பி", "மா", "ஏ", "மே", "ஜூ", "ஜூ", "ஆ", "செ", "அ", "ந", "டி"},
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{"TMT": "துர்க்மெனிஸ்தான் நிலையான நேரம்", "HEOG": "மேற்கு கிரீன்லாந்து கோடை நேரம்", "WAST": "மேற்கு ஆப்பிரிக்க கோடை நேரம்", "BT": "பூடான் நேரம்", "BOT": "பொலிவியா நேரம்", "NZDT": "நியூசிலாந்து பகலொளி நேரம்", "LHST": "லார்ட் ஹோவ் நிலையான நேரம்", "HKT": "ஹாங்காங் நிலையான நேரம்", "CLST": "சிலி கோடை நேரம்", "MYT": "மலேஷிய நேரம்", "∅∅∅": "அசோர்ஸ் கோடை நேரம்", "SAST": "தென் ஆப்பிரிக்க நிலையான நேரம்", "HEEG": "கிழக்கு கிரீன்லாந்து கோடை நேரம்", "HAT": "நியூஃபவுண்ட்லாந்து பகலொளி நேரம்", "EDT": "கிழக்கத்திய பகலொளி நேரம்", "HECU": "கியூபா பகலொளி நேரம்", "SRT": "சுரினாம் நேரம்", "MESZ": "மத்திய ஐரோப்பிய கோடை நேரம்", "MDT": "மவுன்டைன் பகலொளி நேரம்", "VET": "வெனிசுலா நேரம்", "IST": "இந்திய நிலையான நேரம்", "ART": "அர்ஜென்டினா நிலையான நேரம்", "WAT": "மேற்கு ஆப்பிரிக்க நிலையான நேரம்", "COST": "கொலம்பியா கோடை நேரம்", "AWST": "ஆஸ்திரேலியன் மேற்கத்திய நிலையான நேரம்", "MEZ": "மத்திய ஐரோப்பிய நிலையான நேரம்", "TMST": "துர்க்மெனிஸ்தான் கோடை நேரம்", "LHDT": "லார்ட் ஹோவ் பகலொளி நேரம்", "AEST": "ஆஸ்திரேலியன் கிழக்கத்திய நிலையான நேரம்", "GYT": "கயானா நேரம்", "ACST": "ஆஸ்திரேலியன் மத்திய நிலையான நேரம்", "CST": "மத்திய நிலையான நேரம்", "WIT": "கிழக்கத்திய இந்தோனேசிய நேரம்", "EAT": "கிழக்கு ஆப்பிரிக்க நேரம்", "HNEG": "கிழக்கு கிரீன்லாந்து நிலையான நேரம்", "WEZ": "மேற்கத்திய ஐரோப்பிய நிலையான நேரம்", "WIB": "மேற்கத்திய இந்தோனேசிய நேரம்", "HNNOMX": "வடமேற்கு மெக்ஸிகோ நிலையான நேரம்", "JST": "ஜப்பான் நிலையான நேரம்", "HNT": "நியூஃபவுண்ட்லாந்து நிலையான நேரம்", "EST": "கிழக்கத்திய நிலையான நேரம்", "AKST": "அலாஸ்கா நிலையான நேரம்", "CDT": "மத்திய பகலொளி நேரம்", "PST": "பசிபிக் நிலையான நேரம்", "HNCU": "கியூபா நிலையான நேரம்", "HAST": "ஹவாய்-அலேஷியன் நிலையான நேரம்", "WART": "மேற்கத்திய அர்ஜென்டினா நிலையான நேரம்", "CLT": "சிலி நிலையான நேரம்", "ECT": "ஈக்வடார் நேரம்", "WESZ": "மேற்கத்திய ஐரோப்பிய கோடை நேரம்", "SGT": "சிங்கப்பூர் நிலையான நேரம்", "HEPMX": "மெக்ஸிகன் பசிபிக் பகலொளி நேரம்", "MST": "மவுன்டைன் நிலையான நேரம்", "WARST": "மேற்கத்திய அர்ஜென்டினா கோடை நேரம்", "JDT": "ஜப்பான் பகலொளி நேரம்", "ADT": "அட்லாண்டிக் பகலொளி நேரம்", "ChST": "சாமோரோ நிலையான நேரம்", "AWDT": "ஆஸ்திரேலியன் மேற்கத்திய பகலொளி நேரம்", "UYT": "உருகுவே நிலையான நேரம்", "HADT": "ஹவாய்-அலேஷியன் பகலொளி நேரம்", "COT": "கொலம்பியா நிலையான நேரம்", "PDT": "பசிபிக் பகலொளி நேரம்", "OEZ": "கிழக்கத்திய ஐரோப்பிய நிலையான நேரம்", "OESZ": "கிழக்கத்திய ஐரோப்பிய கோடை நேரம்", "ACDT": "ஆஸ்திரேலியன் மத்திய பகலொளி நேரம்", "CHAST": "சத்தாம் நிலையான நேரம்", "CHADT": "சத்தாம் பகலொளி நேரம்", "ACWST": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய நிலையான நேரம்", "HENOMX": "வடமேற்கு மெக்ஸிகோ பகலொளி நேரம்", "AEDT": "ஆஸ்திரேலியன் கிழக்கத்திய பகலொளி நேரம்", "ARST": "அர்ஜென்டினா கோடை நேரம்", "HNOG": "மேற்கு கிரீன்லாந்து நிலையான நேரம்", "HNPM": "செயின்ட் பியரி & மிக்குயிலான் நிலையான நேரம்", "UYST": "உருகுவே கோடை நேரம்", "GFT": "ஃபிரஞ்சு கயானா நேரம்", "AST": "அட்லாண்டிக் நிலையான நேரம்", "HNPMX": "மெக்ஸிகன் பசிபிக் நிலையான நேரம்", "ACWDT": "ஆஸ்திரேலியன் மத்திய மேற்கத்திய பகலொளி நேரம்", "NZST": "நியூசிலாந்து நிலையான நேரம்", "WITA": "மத்திய இந்தோனேசிய நேரம்", "HKST": "ஹாங்காங் கோடை நேரம்", "AKDT": "அலாஸ்கா பகலொளி நேரம்", "CAT": "மத்திய ஆப்பிரிக்க நேரம்", "GMT": "கிரீன்விச் சராசரி நேரம்", "HEPM": "செயின்ட் பியரி & மிக்குயிலான் பகலொளி நேரம்"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (ta *ta_MY) Locale() string {
80         return ta.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'ta_MY'
84 func (ta *ta_MY) PluralsCardinal() []locales.PluralRule {
85         return ta.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'ta_MY'
89 func (ta *ta_MY) PluralsOrdinal() []locales.PluralRule {
90         return ta.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'ta_MY'
94 func (ta *ta_MY) PluralsRange() []locales.PluralRule {
95         return ta.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ta_MY'
99 func (ta *ta_MY) 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 'ta_MY'
111 func (ta *ta_MY) 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 'ta_MY'
116 func (ta *ta_MY) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
117
118         start := ta.CardinalPluralRule(num1, v1)
119         end := ta.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 (ta *ta_MY) MonthAbbreviated(month time.Month) string {
133         return ta.monthsAbbreviated[month]
134 }
135
136 // MonthsAbbreviated returns the locales abbreviated months
137 func (ta *ta_MY) MonthsAbbreviated() []string {
138         return ta.monthsAbbreviated[1:]
139 }
140
141 // MonthNarrow returns the locales narrow month given the 'month' provided
142 func (ta *ta_MY) MonthNarrow(month time.Month) string {
143         return ta.monthsNarrow[month]
144 }
145
146 // MonthsNarrow returns the locales narrow months
147 func (ta *ta_MY) MonthsNarrow() []string {
148         return ta.monthsNarrow[1:]
149 }
150
151 // MonthWide returns the locales wide month given the 'month' provided
152 func (ta *ta_MY) MonthWide(month time.Month) string {
153         return ta.monthsWide[month]
154 }
155
156 // MonthsWide returns the locales wide months
157 func (ta *ta_MY) MonthsWide() []string {
158         return ta.monthsWide[1:]
159 }
160
161 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
162 func (ta *ta_MY) WeekdayAbbreviated(weekday time.Weekday) string {
163         return ta.daysAbbreviated[weekday]
164 }
165
166 // WeekdaysAbbreviated returns the locales abbreviated weekdays
167 func (ta *ta_MY) WeekdaysAbbreviated() []string {
168         return ta.daysAbbreviated
169 }
170
171 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
172 func (ta *ta_MY) WeekdayNarrow(weekday time.Weekday) string {
173         return ta.daysNarrow[weekday]
174 }
175
176 // WeekdaysNarrow returns the locales narrow weekdays
177 func (ta *ta_MY) WeekdaysNarrow() []string {
178         return ta.daysNarrow
179 }
180
181 // WeekdayShort returns the locales short weekday given the 'weekday' provided
182 func (ta *ta_MY) WeekdayShort(weekday time.Weekday) string {
183         return ta.daysShort[weekday]
184 }
185
186 // WeekdaysShort returns the locales short weekdays
187 func (ta *ta_MY) WeekdaysShort() []string {
188         return ta.daysShort
189 }
190
191 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
192 func (ta *ta_MY) WeekdayWide(weekday time.Weekday) string {
193         return ta.daysWide[weekday]
194 }
195
196 // WeekdaysWide returns the locales wide weekdays
197 func (ta *ta_MY) WeekdaysWide() []string {
198         return ta.daysWide
199 }
200
201 // Decimal returns the decimal point of number
202 func (ta *ta_MY) Decimal() string {
203         return ta.decimal
204 }
205
206 // Group returns the group of number
207 func (ta *ta_MY) Group() string {
208         return ta.group
209 }
210
211 // Group returns the minus sign of number
212 func (ta *ta_MY) Minus() string {
213         return ta.minus
214 }
215
216 // FmtNumber returns 'num' with digits/precision of 'v' for 'ta_MY' and handles both Whole and Real numbers based on 'v'
217 func (ta *ta_MY) 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, ta.decimal[0])
229                         inWhole = true
230                         continue
231                 }
232
233                 if inWhole {
234                         if count == 3 {
235                                 b = append(b, ta.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, ta.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 'ta_MY' 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 (ta *ta_MY) 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, ta.decimal[0])
268                         continue
269                 }
270
271                 b = append(b, s[i])
272         }
273
274         if num < 0 {
275                 b = append(b, ta.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, ta.percent...)
284
285         return string(b)
286 }
287
288 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ta_MY'
289 func (ta *ta_MY) FmtCurrency(num float64, v uint64, currency currency.Type) string {
290
291         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
292         symbol := ta.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, ta.decimal[0])
302                         inWhole = true
303                         continue
304                 }
305
306                 if inWhole {
307                         if count == 3 {
308                                 b = append(b, ta.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(ta.currencyPositivePrefix) - 1; j >= 0; j-- {
323                 b = append(b, ta.currencyPositivePrefix[j])
324         }
325
326         if num < 0 {
327                 b = append(b, ta.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, ta.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 'ta_MY'
350 // in accounting notation.
351 func (ta *ta_MY) FmtAccounting(num float64, v uint64, currency currency.Type) string {
352
353         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
354         symbol := ta.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, ta.decimal[0])
364                         inWhole = true
365                         continue
366                 }
367
368                 if inWhole {
369                         if count == 3 {
370                                 b = append(b, ta.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(ta.currencyNegativePrefix) - 1; j >= 0; j-- {
387                         b = append(b, ta.currencyNegativePrefix[j])
388                 }
389
390                 b = append(b, ta.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(ta.currencyPositivePrefix) - 1; j >= 0; j-- {
399                         b = append(b, ta.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, ta.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 'ta_MY'
424 func (ta *ta_MY) FmtDateShort(t time.Time) string {
425
426         b := make([]byte, 0, 32)
427
428         b = strconv.AppendInt(b, int64(t.Day()), 10)
429         b = append(b, []byte{0x2f}...)
430         b = strconv.AppendInt(b, int64(t.Month()), 10)
431         b = append(b, []byte{0x2f}...)
432
433         if t.Year() > 9 {
434                 b = append(b, strconv.Itoa(t.Year())[2:]...)
435         } else {
436                 b = append(b, strconv.Itoa(t.Year())[1:]...)
437         }
438
439         return string(b)
440 }
441
442 // FmtDateMedium returns the medium date representation of 't' for 'ta_MY'
443 func (ta *ta_MY) FmtDateMedium(t time.Time) string {
444
445         b := make([]byte, 0, 32)
446
447         b = strconv.AppendInt(b, int64(t.Day()), 10)
448         b = append(b, []byte{0x20}...)
449         b = append(b, ta.monthsAbbreviated[t.Month()]...)
450         b = append(b, []byte{0x2c, 0x20}...)
451
452         if t.Year() > 0 {
453                 b = strconv.AppendInt(b, int64(t.Year()), 10)
454         } else {
455                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
456         }
457
458         return string(b)
459 }
460
461 // FmtDateLong returns the long date representation of 't' for 'ta_MY'
462 func (ta *ta_MY) FmtDateLong(t time.Time) string {
463
464         b := make([]byte, 0, 32)
465
466         b = strconv.AppendInt(b, int64(t.Day()), 10)
467         b = append(b, []byte{0x20}...)
468         b = append(b, ta.monthsWide[t.Month()]...)
469         b = append(b, []byte{0x2c, 0x20}...)
470
471         if t.Year() > 0 {
472                 b = strconv.AppendInt(b, int64(t.Year()), 10)
473         } else {
474                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
475         }
476
477         return string(b)
478 }
479
480 // FmtDateFull returns the full date representation of 't' for 'ta_MY'
481 func (ta *ta_MY) FmtDateFull(t time.Time) string {
482
483         b := make([]byte, 0, 32)
484
485         b = append(b, ta.daysWide[t.Weekday()]...)
486         b = append(b, []byte{0x2c, 0x20}...)
487         b = strconv.AppendInt(b, int64(t.Day()), 10)
488         b = append(b, []byte{0x20}...)
489         b = append(b, ta.monthsWide[t.Month()]...)
490         b = append(b, []byte{0x2c, 0x20}...)
491
492         if t.Year() > 0 {
493                 b = strconv.AppendInt(b, int64(t.Year()), 10)
494         } else {
495                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
496         }
497
498         return string(b)
499 }
500
501 // FmtTimeShort returns the short time representation of 't' for 'ta_MY'
502 func (ta *ta_MY) FmtTimeShort(t time.Time) string {
503
504         b := make([]byte, 0, 32)
505
506         if t.Hour() < 12 {
507                 b = append(b, ta.periodsAbbreviated[0]...)
508         } else {
509                 b = append(b, ta.periodsAbbreviated[1]...)
510         }
511
512         b = append(b, []byte{0x20}...)
513
514         h := t.Hour()
515
516         if h > 12 {
517                 h -= 12
518         }
519
520         b = strconv.AppendInt(b, int64(h), 10)
521         b = append(b, ta.timeSeparator...)
522
523         if t.Minute() < 10 {
524                 b = append(b, '0')
525         }
526
527         b = strconv.AppendInt(b, int64(t.Minute()), 10)
528
529         return string(b)
530 }
531
532 // FmtTimeMedium returns the medium time representation of 't' for 'ta_MY'
533 func (ta *ta_MY) FmtTimeMedium(t time.Time) string {
534
535         b := make([]byte, 0, 32)
536
537         if t.Hour() < 12 {
538                 b = append(b, ta.periodsAbbreviated[0]...)
539         } else {
540                 b = append(b, ta.periodsAbbreviated[1]...)
541         }
542
543         b = append(b, []byte{0x20}...)
544
545         h := t.Hour()
546
547         if h > 12 {
548                 h -= 12
549         }
550
551         b = strconv.AppendInt(b, int64(h), 10)
552         b = append(b, ta.timeSeparator...)
553
554         if t.Minute() < 10 {
555                 b = append(b, '0')
556         }
557
558         b = strconv.AppendInt(b, int64(t.Minute()), 10)
559         b = append(b, ta.timeSeparator...)
560
561         if t.Second() < 10 {
562                 b = append(b, '0')
563         }
564
565         b = strconv.AppendInt(b, int64(t.Second()), 10)
566
567         return string(b)
568 }
569
570 // FmtTimeLong returns the long time representation of 't' for 'ta_MY'
571 func (ta *ta_MY) FmtTimeLong(t time.Time) string {
572
573         b := make([]byte, 0, 32)
574
575         if t.Hour() < 12 {
576                 b = append(b, ta.periodsAbbreviated[0]...)
577         } else {
578                 b = append(b, ta.periodsAbbreviated[1]...)
579         }
580
581         b = append(b, []byte{0x20}...)
582
583         h := t.Hour()
584
585         if h > 12 {
586                 h -= 12
587         }
588
589         b = strconv.AppendInt(b, int64(h), 10)
590         b = append(b, ta.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, ta.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}...)
605
606         tz, _ := t.Zone()
607         b = append(b, tz...)
608
609         return string(b)
610 }
611
612 // FmtTimeFull returns the full time representation of 't' for 'ta_MY'
613 func (ta *ta_MY) FmtTimeFull(t time.Time) string {
614
615         b := make([]byte, 0, 32)
616
617         if t.Hour() < 12 {
618                 b = append(b, ta.periodsAbbreviated[0]...)
619         } else {
620                 b = append(b, ta.periodsAbbreviated[1]...)
621         }
622
623         b = append(b, []byte{0x20}...)
624
625         h := t.Hour()
626
627         if h > 12 {
628                 h -= 12
629         }
630
631         b = strconv.AppendInt(b, int64(h), 10)
632         b = append(b, ta.timeSeparator...)
633
634         if t.Minute() < 10 {
635                 b = append(b, '0')
636         }
637
638         b = strconv.AppendInt(b, int64(t.Minute()), 10)
639         b = append(b, ta.timeSeparator...)
640
641         if t.Second() < 10 {
642                 b = append(b, '0')
643         }
644
645         b = strconv.AppendInt(b, int64(t.Second()), 10)
646         b = append(b, []byte{0x20}...)
647
648         tz, _ := t.Zone()
649
650         if btz, ok := ta.timezones[tz]; ok {
651                 b = append(b, btz...)
652         } else {
653                 b = append(b, tz...)
654         }
655
656         return string(b)
657 }