OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / fil_PH / fil_PH.go
1 package fil_PH
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 fil_PH 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         currencyNegativePrefix string
26         currencyNegativeSuffix 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 'fil_PH' locale
45 func New() locales.Translator {
46         return &fil_PH{
47                 locale:                 "fil_PH",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{2, 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", "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"},
59                 currencyNegativePrefix: "(",
60                 currencyNegativeSuffix: ")",
61                 monthsAbbreviated:      []string{"", "Ene", "Peb", "Mar", "Abr", "May", "Hun", "Hul", "Ago", "Set", "Okt", "Nob", "Dis"},
62                 monthsNarrow:           []string{"", "Ene", "Peb", "Mar", "Abr", "May", "Hun", "Hul", "Ago", "Set", "Okt", "Nob", "Dis"},
63                 monthsWide:             []string{"", "Enero", "Pebrero", "Marso", "Abril", "Mayo", "Hunyo", "Hulyo", "Agosto", "Setyembre", "Oktubre", "Nobyembre", "Disyembre"},
64                 daysAbbreviated:        []string{"Lin", "Lun", "Mar", "Miy", "Huw", "Biy", "Sab"},
65                 daysNarrow:             []string{"Lin", "Lun", "Mar", "Miy", "Huw", "Biy", "Sab"},
66                 daysShort:              []string{"Li", "Lu", "Ma", "Mi", "Hu", "Bi", "Sa"},
67                 daysWide:               []string{"Linggo", "Lunes", "Martes", "Miyerkules", "Huwebes", "Biyernes", "Sabado"},
68                 periodsAbbreviated:     []string{"AM", "PM"},
69                 periodsNarrow:          []string{"am", "pm"},
70                 periodsWide:            []string{"AM", "PM"},
71                 erasAbbreviated:        []string{"BC", "AD"},
72                 erasNarrow:             []string{"", ""},
73                 erasWide:               []string{"BC", "AD"},
74                 timezones:              map[string]string{"HEPM": "Daylight Time sa Saint Pierre and Miquelon", "UYT": "Standard na Oras sa Uruguay", "VET": "Oras sa Venezuela", "IST": "Standard na Oras sa Bhutan", "∅∅∅": "Oras sa Tag-init ng Azores", "ADT": "Daylight Time sa Atlantiko", "HNT": "Standard na Oras sa Newfoundland", "HEPMX": "Daylight Time sa Pasipiko ng Mexico", "ACWST": "Standard Time ng Gitnang Kanluran ng Australya", "ChST": "Standard na Oras sa Chamorro", "HECU": "Daylight Time sa Cuba", "AWST": "Standard Time ng Kanlurang Australya", "HADT": "Oras sa Tag-init ng Hawaii-Aleutian", "JST": "Standard na Oras sa Japan", "SRT": "Oras sa Suriname", "HAST": "Standard na Oras sa Hawaii-Aleutian", "TMST": "Oras sa Tag-init ng Turkmenistan", "WARST": "Oras sa Tag-init ng Kanlurang Argentina", "CAT": "Oras sa Gitnang Africa", "ACWDT": "Daylight Time ng Gitnang Kanluran ng Australya", "GMT": "Greenwich Mean Time", "CHADT": "Daylight Time sa Chatham", "OESZ": "Oras sa Tag-init ng Silangang Europe", "AEST": "Standard Time ng Silangang Australya", "WAT": "Standard na Oras sa Kanlurang Africa", "EDT": "Eastern Daylight Time", "AKST": "Standard na Oras sa Alaska", "AWDT": "Daylight Time sa Kanlurang Australya", "ARST": "Oras sa Tag-init ng Argentina", "COT": "Standard na Oras sa Colombia", "WESZ": "Oras sa Tag-init ng Kanlurang Europe", "HNPMX": "Standard na Oras sa Pasipiko ng Mexico", "CST": "Sentral na Karaniwang Oras", "WIB": "Oras ng Kanlurang Indonesiya", "MEZ": "Standard na Oras sa Gitnang Europe", "NZST": "Standard na Oras sa New Zealand", "HNNOMX": "Standard na Oras sa Hilagang-kanlurang Mexico", "WITA": "Oras ng Gitnang Indonesiya", "HNEG": "Standard na Oras sa Silangang Greenland", "ACST": "Standard Time ng Gitnang Australya", "ECT": "Oras sa Ecuador", "MDT": "Daylight Time sa Bundok", "HEEG": "Oras sa Tag-init ng Silangang Greenland", "PST": "Standard na Oras sa Pasipiko", "BOT": "Oras sa Bolivia", "TMT": "Standard na Oras sa Turkmenistan", "MESZ": "Oras sa Tag-init ng Gitnang Europe", "NZDT": "Daylight Time sa New Zealand", "AEDT": "Daylight Time ng Silangang Australya", "HEOG": "Oras sa Tag-init ng Kanlurang Greenland", "CLT": "Standard na Oras sa Chile", "EST": "Eastern na Standard na Oras", "SGT": "Standard na Oras sa Singapore", "HENOMX": "Daylight Time sa Hilagang-kanlurang Mexico", "WART": "Standard na Oras sa Kanlurang Argentina", "ART": "Standard na Oras sa Argentina", "ACDT": "Daylight Time ng Gitnang Australya", "MYT": "Oras ng Malaysia", "EAT": "Oras sa Silangang Africa", "CHAST": "Standard na Oras sa Chatham", "HNCU": "Standard na Oras sa Cuba", "HNPM": "Standard na Oras sa Saint Pierre and Miquelon", "WEZ": "Standard na Oras sa Kanlurang Europe", "PDT": "Daylight Time sa Pasipiko", "UYST": "Oras sa Tag-init ng Uruguay", "JDT": "Daylight Time sa Japan", "LHST": "Standard na Oras sa Lord Howe", "HNOG": "Standard na Oras sa Kanlurang Greenland", "HAT": "Daylight Time sa Newfoundland", "COST": "Oras sa Tag-init ng Colombia", "WIT": "Oras ng Silangang Indonesiya", "MST": "Karaniwang Oras sa Bundok", "HKST": "Oras sa Tag-init ng Hong Kong", "CLST": "Oras sa Tag-init ng Chile", "GYT": "Oras sa Guyana", "AKDT": "Daylight Time sa Alaska", "SAST": "Oras sa Timog Africa", "WAST": "Oras sa Tag-init ng Kanlurang Africa", "GFT": "Oras sa French Guiana", "BT": "Oras sa Bhutan", "OEZ": "Standard na Oras sa Silangang Europe", "LHDT": "Daylight Time sa Lorde Howe", "AST": "Standard na Oras sa Atlantiko", "HKT": "Standard na Oras sa Hong Kong", "CDT": "Sentral na Daylight Time"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (fil *fil_PH) Locale() string {
80         return fil.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'fil_PH'
84 func (fil *fil_PH) PluralsCardinal() []locales.PluralRule {
85         return fil.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'fil_PH'
89 func (fil *fil_PH) PluralsOrdinal() []locales.PluralRule {
90         return fil.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'fil_PH'
94 func (fil *fil_PH) PluralsRange() []locales.PluralRule {
95         return fil.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'fil_PH'
99 func (fil *fil_PH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102         i := int64(n)
103         f := locales.F(n, v)
104         iMod10 := i % 10
105         fMod10 := f % 10
106
107         if (v == 0 && (i == 1 || i == 2 || i == 3)) || (v == 0 && (iMod10 != 4 && iMod10 != 6 && iMod10 != 9)) || (v != 0 && (fMod10 != 4 && fMod10 != 6 && fMod10 != 9)) {
108                 return locales.PluralRuleOne
109         }
110
111         return locales.PluralRuleOther
112 }
113
114 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'fil_PH'
115 func (fil *fil_PH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
116
117         n := math.Abs(num)
118
119         if n == 1 {
120                 return locales.PluralRuleOne
121         }
122
123         return locales.PluralRuleOther
124 }
125
126 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'fil_PH'
127 func (fil *fil_PH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
128
129         start := fil.CardinalPluralRule(num1, v1)
130         end := fil.CardinalPluralRule(num2, v2)
131
132         if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
133                 return locales.PluralRuleOne
134         } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
135                 return locales.PluralRuleOther
136         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
137                 return locales.PluralRuleOne
138         }
139
140         return locales.PluralRuleOther
141
142 }
143
144 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
145 func (fil *fil_PH) MonthAbbreviated(month time.Month) string {
146         return fil.monthsAbbreviated[month]
147 }
148
149 // MonthsAbbreviated returns the locales abbreviated months
150 func (fil *fil_PH) MonthsAbbreviated() []string {
151         return fil.monthsAbbreviated[1:]
152 }
153
154 // MonthNarrow returns the locales narrow month given the 'month' provided
155 func (fil *fil_PH) MonthNarrow(month time.Month) string {
156         return fil.monthsNarrow[month]
157 }
158
159 // MonthsNarrow returns the locales narrow months
160 func (fil *fil_PH) MonthsNarrow() []string {
161         return fil.monthsNarrow[1:]
162 }
163
164 // MonthWide returns the locales wide month given the 'month' provided
165 func (fil *fil_PH) MonthWide(month time.Month) string {
166         return fil.monthsWide[month]
167 }
168
169 // MonthsWide returns the locales wide months
170 func (fil *fil_PH) MonthsWide() []string {
171         return fil.monthsWide[1:]
172 }
173
174 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
175 func (fil *fil_PH) WeekdayAbbreviated(weekday time.Weekday) string {
176         return fil.daysAbbreviated[weekday]
177 }
178
179 // WeekdaysAbbreviated returns the locales abbreviated weekdays
180 func (fil *fil_PH) WeekdaysAbbreviated() []string {
181         return fil.daysAbbreviated
182 }
183
184 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
185 func (fil *fil_PH) WeekdayNarrow(weekday time.Weekday) string {
186         return fil.daysNarrow[weekday]
187 }
188
189 // WeekdaysNarrow returns the locales narrow weekdays
190 func (fil *fil_PH) WeekdaysNarrow() []string {
191         return fil.daysNarrow
192 }
193
194 // WeekdayShort returns the locales short weekday given the 'weekday' provided
195 func (fil *fil_PH) WeekdayShort(weekday time.Weekday) string {
196         return fil.daysShort[weekday]
197 }
198
199 // WeekdaysShort returns the locales short weekdays
200 func (fil *fil_PH) WeekdaysShort() []string {
201         return fil.daysShort
202 }
203
204 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
205 func (fil *fil_PH) WeekdayWide(weekday time.Weekday) string {
206         return fil.daysWide[weekday]
207 }
208
209 // WeekdaysWide returns the locales wide weekdays
210 func (fil *fil_PH) WeekdaysWide() []string {
211         return fil.daysWide
212 }
213
214 // Decimal returns the decimal point of number
215 func (fil *fil_PH) Decimal() string {
216         return fil.decimal
217 }
218
219 // Group returns the group of number
220 func (fil *fil_PH) Group() string {
221         return fil.group
222 }
223
224 // Group returns the minus sign of number
225 func (fil *fil_PH) Minus() string {
226         return fil.minus
227 }
228
229 // FmtNumber returns 'num' with digits/precision of 'v' for 'fil_PH' and handles both Whole and Real numbers based on 'v'
230 func (fil *fil_PH) FmtNumber(num float64, v uint64) string {
231
232         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
233         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
234         count := 0
235         inWhole := v == 0
236         b := make([]byte, 0, l)
237
238         for i := len(s) - 1; i >= 0; i-- {
239
240                 if s[i] == '.' {
241                         b = append(b, fil.decimal[0])
242                         inWhole = true
243                         continue
244                 }
245
246                 if inWhole {
247                         if count == 3 {
248                                 b = append(b, fil.group[0])
249                                 count = 1
250                         } else {
251                                 count++
252                         }
253                 }
254
255                 b = append(b, s[i])
256         }
257
258         if num < 0 {
259                 b = append(b, fil.minus[0])
260         }
261
262         // reverse
263         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
264                 b[i], b[j] = b[j], b[i]
265         }
266
267         return string(b)
268 }
269
270 // FmtPercent returns 'num' with digits/precision of 'v' for 'fil_PH' and handles both Whole and Real numbers based on 'v'
271 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
272 func (fil *fil_PH) FmtPercent(num float64, v uint64) string {
273         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
274         l := len(s) + 3
275         b := make([]byte, 0, l)
276
277         for i := len(s) - 1; i >= 0; i-- {
278
279                 if s[i] == '.' {
280                         b = append(b, fil.decimal[0])
281                         continue
282                 }
283
284                 b = append(b, s[i])
285         }
286
287         if num < 0 {
288                 b = append(b, fil.minus[0])
289         }
290
291         // reverse
292         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
293                 b[i], b[j] = b[j], b[i]
294         }
295
296         b = append(b, fil.percent...)
297
298         return string(b)
299 }
300
301 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'fil_PH'
302 func (fil *fil_PH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
303
304         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
305         symbol := fil.currencies[currency]
306         l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
307         count := 0
308         inWhole := v == 0
309         b := make([]byte, 0, l)
310
311         for i := len(s) - 1; i >= 0; i-- {
312
313                 if s[i] == '.' {
314                         b = append(b, fil.decimal[0])
315                         inWhole = true
316                         continue
317                 }
318
319                 if inWhole {
320                         if count == 3 {
321                                 b = append(b, fil.group[0])
322                                 count = 1
323                         } else {
324                                 count++
325                         }
326                 }
327
328                 b = append(b, s[i])
329         }
330
331         for j := len(symbol) - 1; j >= 0; j-- {
332                 b = append(b, symbol[j])
333         }
334
335         if num < 0 {
336                 b = append(b, fil.minus[0])
337         }
338
339         // reverse
340         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
341                 b[i], b[j] = b[j], b[i]
342         }
343
344         if int(v) < 2 {
345
346                 if v == 0 {
347                         b = append(b, fil.decimal...)
348                 }
349
350                 for i := 0; i < 2-int(v); i++ {
351                         b = append(b, '0')
352                 }
353         }
354
355         return string(b)
356 }
357
358 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'fil_PH'
359 // in accounting notation.
360 func (fil *fil_PH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
361
362         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
363         symbol := fil.currencies[currency]
364         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
365         count := 0
366         inWhole := v == 0
367         b := make([]byte, 0, l)
368
369         for i := len(s) - 1; i >= 0; i-- {
370
371                 if s[i] == '.' {
372                         b = append(b, fil.decimal[0])
373                         inWhole = true
374                         continue
375                 }
376
377                 if inWhole {
378                         if count == 3 {
379                                 b = append(b, fil.group[0])
380                                 count = 1
381                         } else {
382                                 count++
383                         }
384                 }
385
386                 b = append(b, s[i])
387         }
388
389         if num < 0 {
390
391                 for j := len(symbol) - 1; j >= 0; j-- {
392                         b = append(b, symbol[j])
393                 }
394
395                 b = append(b, fil.currencyNegativePrefix[0])
396
397         } else {
398
399                 for j := len(symbol) - 1; j >= 0; j-- {
400                         b = append(b, symbol[j])
401                 }
402
403         }
404
405         // reverse
406         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
407                 b[i], b[j] = b[j], b[i]
408         }
409
410         if int(v) < 2 {
411
412                 if v == 0 {
413                         b = append(b, fil.decimal...)
414                 }
415
416                 for i := 0; i < 2-int(v); i++ {
417                         b = append(b, '0')
418                 }
419         }
420
421         if num < 0 {
422                 b = append(b, fil.currencyNegativeSuffix...)
423         }
424
425         return string(b)
426 }
427
428 // FmtDateShort returns the short date representation of 't' for 'fil_PH'
429 func (fil *fil_PH) FmtDateShort(t time.Time) string {
430
431         b := make([]byte, 0, 32)
432
433         b = strconv.AppendInt(b, int64(t.Month()), 10)
434         b = append(b, []byte{0x2f}...)
435         b = strconv.AppendInt(b, int64(t.Day()), 10)
436         b = append(b, []byte{0x2f}...)
437
438         if t.Year() > 9 {
439                 b = append(b, strconv.Itoa(t.Year())[2:]...)
440         } else {
441                 b = append(b, strconv.Itoa(t.Year())[1:]...)
442         }
443
444         return string(b)
445 }
446
447 // FmtDateMedium returns the medium date representation of 't' for 'fil_PH'
448 func (fil *fil_PH) FmtDateMedium(t time.Time) string {
449
450         b := make([]byte, 0, 32)
451
452         b = append(b, fil.monthsAbbreviated[t.Month()]...)
453         b = append(b, []byte{0x20}...)
454         b = strconv.AppendInt(b, int64(t.Day()), 10)
455         b = append(b, []byte{0x2c, 0x20}...)
456
457         if t.Year() > 0 {
458                 b = strconv.AppendInt(b, int64(t.Year()), 10)
459         } else {
460                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
461         }
462
463         return string(b)
464 }
465
466 // FmtDateLong returns the long date representation of 't' for 'fil_PH'
467 func (fil *fil_PH) FmtDateLong(t time.Time) string {
468
469         b := make([]byte, 0, 32)
470
471         b = append(b, fil.monthsWide[t.Month()]...)
472         b = append(b, []byte{0x20}...)
473         b = strconv.AppendInt(b, int64(t.Day()), 10)
474         b = append(b, []byte{0x2c, 0x20}...)
475
476         if t.Year() > 0 {
477                 b = strconv.AppendInt(b, int64(t.Year()), 10)
478         } else {
479                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
480         }
481
482         return string(b)
483 }
484
485 // FmtDateFull returns the full date representation of 't' for 'fil_PH'
486 func (fil *fil_PH) FmtDateFull(t time.Time) string {
487
488         b := make([]byte, 0, 32)
489
490         b = append(b, fil.daysWide[t.Weekday()]...)
491         b = append(b, []byte{0x2c, 0x20}...)
492         b = append(b, fil.monthsWide[t.Month()]...)
493         b = append(b, []byte{0x20}...)
494         b = strconv.AppendInt(b, int64(t.Day()), 10)
495         b = append(b, []byte{0x2c, 0x20}...)
496
497         if t.Year() > 0 {
498                 b = strconv.AppendInt(b, int64(t.Year()), 10)
499         } else {
500                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
501         }
502
503         return string(b)
504 }
505
506 // FmtTimeShort returns the short time representation of 't' for 'fil_PH'
507 func (fil *fil_PH) FmtTimeShort(t time.Time) string {
508
509         b := make([]byte, 0, 32)
510
511         h := t.Hour()
512
513         if h > 12 {
514                 h -= 12
515         }
516
517         b = strconv.AppendInt(b, int64(h), 10)
518         b = append(b, fil.timeSeparator...)
519
520         if t.Minute() < 10 {
521                 b = append(b, '0')
522         }
523
524         b = strconv.AppendInt(b, int64(t.Minute()), 10)
525         b = append(b, []byte{0x20}...)
526
527         if t.Hour() < 12 {
528                 b = append(b, fil.periodsAbbreviated[0]...)
529         } else {
530                 b = append(b, fil.periodsAbbreviated[1]...)
531         }
532
533         return string(b)
534 }
535
536 // FmtTimeMedium returns the medium time representation of 't' for 'fil_PH'
537 func (fil *fil_PH) FmtTimeMedium(t time.Time) string {
538
539         b := make([]byte, 0, 32)
540
541         h := t.Hour()
542
543         if h > 12 {
544                 h -= 12
545         }
546
547         b = strconv.AppendInt(b, int64(h), 10)
548         b = append(b, fil.timeSeparator...)
549
550         if t.Minute() < 10 {
551                 b = append(b, '0')
552         }
553
554         b = strconv.AppendInt(b, int64(t.Minute()), 10)
555         b = append(b, fil.timeSeparator...)
556
557         if t.Second() < 10 {
558                 b = append(b, '0')
559         }
560
561         b = strconv.AppendInt(b, int64(t.Second()), 10)
562         b = append(b, []byte{0x20}...)
563
564         if t.Hour() < 12 {
565                 b = append(b, fil.periodsAbbreviated[0]...)
566         } else {
567                 b = append(b, fil.periodsAbbreviated[1]...)
568         }
569
570         return string(b)
571 }
572
573 // FmtTimeLong returns the long time representation of 't' for 'fil_PH'
574 func (fil *fil_PH) FmtTimeLong(t time.Time) string {
575
576         b := make([]byte, 0, 32)
577
578         h := t.Hour()
579
580         if h > 12 {
581                 h -= 12
582         }
583
584         b = strconv.AppendInt(b, int64(h), 10)
585         b = append(b, fil.timeSeparator...)
586
587         if t.Minute() < 10 {
588                 b = append(b, '0')
589         }
590
591         b = strconv.AppendInt(b, int64(t.Minute()), 10)
592         b = append(b, fil.timeSeparator...)
593
594         if t.Second() < 10 {
595                 b = append(b, '0')
596         }
597
598         b = strconv.AppendInt(b, int64(t.Second()), 10)
599         b = append(b, []byte{0x20}...)
600
601         if t.Hour() < 12 {
602                 b = append(b, fil.periodsAbbreviated[0]...)
603         } else {
604                 b = append(b, fil.periodsAbbreviated[1]...)
605         }
606
607         b = append(b, []byte{0x20}...)
608
609         tz, _ := t.Zone()
610         b = append(b, tz...)
611
612         return string(b)
613 }
614
615 // FmtTimeFull returns the full time representation of 't' for 'fil_PH'
616 func (fil *fil_PH) FmtTimeFull(t time.Time) string {
617
618         b := make([]byte, 0, 32)
619
620         h := t.Hour()
621
622         if h > 12 {
623                 h -= 12
624         }
625
626         b = strconv.AppendInt(b, int64(h), 10)
627         b = append(b, fil.timeSeparator...)
628
629         if t.Minute() < 10 {
630                 b = append(b, '0')
631         }
632
633         b = strconv.AppendInt(b, int64(t.Minute()), 10)
634         b = append(b, fil.timeSeparator...)
635
636         if t.Second() < 10 {
637                 b = append(b, '0')
638         }
639
640         b = strconv.AppendInt(b, int64(t.Second()), 10)
641         b = append(b, []byte{0x20}...)
642
643         if t.Hour() < 12 {
644                 b = append(b, fil.periodsAbbreviated[0]...)
645         } else {
646                 b = append(b, fil.periodsAbbreviated[1]...)
647         }
648
649         b = append(b, []byte{0x20}...)
650
651         tz, _ := t.Zone()
652
653         if btz, ok := fil.timezones[tz]; ok {
654                 b = append(b, btz...)
655         } else {
656                 b = append(b, tz...)
657         }
658
659         return string(b)
660 }