OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / ur / ur.go
1 package ur
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 ur 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         monthsAbbreviated  []string
26         monthsNarrow       []string
27         monthsWide         []string
28         daysAbbreviated    []string
29         daysNarrow         []string
30         daysShort          []string
31         daysWide           []string
32         periodsAbbreviated []string
33         periodsNarrow      []string
34         periodsShort       []string
35         periodsWide        []string
36         erasAbbreviated    []string
37         erasNarrow         []string
38         erasWide           []string
39         timezones          map[string]string
40 }
41
42 // New returns a new instance of translator for the 'ur' locale
43 func New() locales.Translator {
44         return &ur{
45                 locale:             "ur",
46                 pluralsCardinal:    []locales.PluralRule{2, 6},
47                 pluralsOrdinal:     []locales.PluralRule{6},
48                 pluralsRange:       []locales.PluralRule{6},
49                 decimal:            ".",
50                 group:              ",",
51                 minus:              "‎-",
52                 percent:            "%",
53                 perMille:           "‰",
54                 timeSeparator:      ":",
55                 inifinity:          "∞",
56                 currencies:         []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "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", "Rs", "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"},
57                 monthsAbbreviated:  []string{"", "جنوری", "فروری", "مارچ", "اپریل", "مئی", "جون", "جولائی", "اگست", "ستمبر", "اکتوبر", "نومبر", "دسمبر"},
58                 monthsNarrow:       []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
59                 monthsWide:         []string{"", "جنوری", "فروری", "مارچ", "اپریل", "مئی", "جون", "جولائی", "اگست", "ستمبر", "اکتوبر", "نومبر", "دسمبر"},
60                 daysAbbreviated:    []string{"اتوار", "سوموار", "منگل", "بدھ", "جمعرات", "جمعہ", "ہفتہ"},
61                 daysNarrow:         []string{"S", "M", "T", "W", "T", "F", "S"},
62                 daysShort:          []string{"اتوار", "سوموار", "منگل", "بدھ", "جمعرات", "جمعہ", "ہفتہ"},
63                 daysWide:           []string{"اتوار", "سوموار", "منگل", "بدھ", "جمعرات", "جمعہ", "ہفتہ"},
64                 periodsAbbreviated: []string{"AM", "PM"},
65                 periodsNarrow:      []string{"a", "p"},
66                 periodsWide:        []string{"AM", "PM"},
67                 erasAbbreviated:    []string{"قبل مسیح", "عیسوی"},
68                 erasNarrow:         []string{"", ""},
69                 erasWide:           []string{"قبل مسیح", "عیسوی"},
70                 timezones:          map[string]string{"TMT": "ترکمانستان کا معیاری وقت", "HEPM": "سینٹ پیئر اور مکلیئون ڈے لائٹ ٹائم", "ACWST": "آسٹریلین سنٹرل ویسٹرن اسٹینڈرڈ ٹائم", "JST": "جاپان سٹینڈرڈ ٹائم", "HNOG": "مغربی گرین لینڈ اسٹینڈرڈ ٹائم", "GFT": "فرینچ گیانا کا وقت", "ACST": "آسٹریلین سنٹرل اسٹینڈرڈ ٹائم", "ECT": "ایکواڈور کا وقت", "BT": "بھوٹان کا وقت", "MEZ": "وسطی یورپ کا معیاری وقت", "TMST": "ترکمانستان کا موسم گرما کا وقت", "MST": "ماؤنٹین اسٹینڈرڈ ٹائم", "HNNOMX": "شمال مغربی میکسیکو اسٹینڈرڈ ٹائم", "EAT": "مشرقی افریقہ ٹائم", "HKST": "ہانگ کانگ سمر ٹائم", "CHAST": "چیتھم اسٹینڈرڈ ٹائم", "COT": "کولمبیا کا معیاری وقت", "UYST": "یوروگوئے کا موسم گرما کا وقت", "VET": "وینزوئیلا کا وقت", "IST": "ہندوستان کا معیاری وقت", "ADT": "اٹلانٹک ڈے لائٹ ٹائم", "AEDT": "آسٹریلین ایسٹرن ڈے لائٹ ٹائم", "WAST": "مغربی افریقہ سمر ٹائم", "HNEG": "مشرقی گرین لینڈ اسٹینڈرڈ ٹائم", "AKST": "الاسکا اسٹینڈرڈ ٹائم", "WEZ": "مغربی یورپ کا معیاری وقت", "PDT": "پیسفک ڈے لائٹ ٹائم", "∅∅∅": "ازوریس کا موسم گرما کا وقت", "SAST": "جنوبی افریقہ سٹینڈرڈ ٹائم", "HAT": "نیو فاؤنڈ لینڈ ڈے لائٹ ٹائم", "GYT": "گیانا کا وقت", "CDT": "سنٹرل ڈے لائٹ ٹائم", "LHST": "لارڈ ہووے اسٹینڈرڈ ٹائم", "MDT": "ماؤنٹین ڈے لائٹ ٹائم", "HEOG": "مغربی گرین لینڈ کا موسم گرما کا وقت", "NZDT": "نیوزی لینڈ ڈے لائٹ ٹائم", "OEZ": "مشرقی یورپ کا معیاری وقت", "JDT": "جاپان ڈے لائٹ ٹائم", "WAT": "مغربی افریقہ سٹینڈرڈ ٹائم", "HKT": "ہانگ کانگ سٹینڈرڈ ٹائم", "GMT": "گرین وچ کا اصل وقت", "WART": "مغربی ارجنٹینا کا معیاری وقت", "AKDT": "الاسکا ڈے لائٹ ٹائم", "CAT": "وسطی افریقہ ٹائم", "ChST": "چامورو سٹینڈرڈ ٹائم", "BOT": "بولیویا کا وقت", "CST": "سنٹرل اسٹینڈرڈ ٹائم", "SRT": "سورینام کا وقت", "MESZ": "وسطی یورپ کا موسم گرما کا وقت", "WARST": "مغربی ارجنٹینا کا موسم گرما کا وقت", "EST": "ایسٹرن اسٹینڈرڈ ٹائم", "HECU": "کیوبا ڈے لائٹ ٹائم", "AWST": "آسٹریلیا ویسٹرن اسٹینڈرڈ ٹائم", "ARST": "ارجنٹینا سمر ٹائم", "HEEG": "مشرقی گرین لینڈ کا موسم گرما کا وقت", "WIT": "مشرقی انڈونیشیا ٹائم", "WITA": "وسطی انڈونیشیا ٹائم", "COST": "کولمبیا کا موسم گرما کا وقت", "EDT": "ایسٹرن ڈے لائٹ ٹائم", "WESZ": "مغربی یورپ کا موسم گرما کا وقت", "HNPM": "سینٹ پیئر اور مکلیئون اسٹینڈرڈ ٹائم", "HAST": "ہوائی الیوٹیئن اسٹینڈرڈ ٹائم", "HNT": "نیو فاؤنڈ لینڈ اسٹینڈرڈ ٹائم", "PST": "پیسفک اسٹینڈرڈ ٹائم", "CHADT": "چیتھم ڈے لائٹ ٹائم", "UYT": "یوروگوئے کا معیاری وقت", "CLT": "چلی کا معیاری وقت", "CLST": "چلی کا موسم گرما کا وقت", "ACWDT": "آسٹریلین سنٹرل ویسٹرن ڈے لائٹ ٹائم", "MYT": "ملیشیا ٹائم", "LHDT": "لارڈ ہووے ڈے لائٹ ٹائم", "HENOMX": "شمال مغربی میکسیکو ڈے لائٹ ٹائم", "HNPMX": "میکسیکن پیسفک اسٹینڈرڈ ٹائم", "HEPMX": "میکسیکن پیسفک ڈے لائٹ ٹائم", "WIB": "مغربی انڈونیشیا ٹائم", "OESZ": "مشرقی یورپ کا موسم گرما کا وقت", "AST": "اٹلانٹک اسٹینڈرڈ ٹائم", "ART": "ارجنٹینا سٹینڈرڈ ٹائم", "ACDT": "آسٹریلین سنٹرل ڈے لائٹ ٹائم", "SGT": "سنگاپور سٹینڈرڈ ٹائم", "HNCU": "کیوبا اسٹینڈرڈ ٹائم", "HADT": "ہوائی الیوٹیئن ڈے لائٹ ٹائم", "NZST": "نیوزی لینڈ کا معیاری وقت", "AEST": "آسٹریلین ایسٹرن اسٹینڈرڈ ٹائم", "AWDT": "آسٹریلین ویسٹرن ڈے لائٹ ٹائم"},
71         }
72 }
73
74 // Locale returns the current translators string locale
75 func (ur *ur) Locale() string {
76         return ur.locale
77 }
78
79 // PluralsCardinal returns the list of cardinal plural rules associated with 'ur'
80 func (ur *ur) PluralsCardinal() []locales.PluralRule {
81         return ur.pluralsCardinal
82 }
83
84 // PluralsOrdinal returns the list of ordinal plural rules associated with 'ur'
85 func (ur *ur) PluralsOrdinal() []locales.PluralRule {
86         return ur.pluralsOrdinal
87 }
88
89 // PluralsRange returns the list of range plural rules associated with 'ur'
90 func (ur *ur) PluralsRange() []locales.PluralRule {
91         return ur.pluralsRange
92 }
93
94 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ur'
95 func (ur *ur) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
96
97         n := math.Abs(num)
98         i := int64(n)
99
100         if i == 1 && v == 0 {
101                 return locales.PluralRuleOne
102         }
103
104         return locales.PluralRuleOther
105 }
106
107 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ur'
108 func (ur *ur) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
109         return locales.PluralRuleOther
110 }
111
112 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ur'
113 func (ur *ur) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
114         return locales.PluralRuleOther
115 }
116
117 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
118 func (ur *ur) MonthAbbreviated(month time.Month) string {
119         return ur.monthsAbbreviated[month]
120 }
121
122 // MonthsAbbreviated returns the locales abbreviated months
123 func (ur *ur) MonthsAbbreviated() []string {
124         return ur.monthsAbbreviated[1:]
125 }
126
127 // MonthNarrow returns the locales narrow month given the 'month' provided
128 func (ur *ur) MonthNarrow(month time.Month) string {
129         return ur.monthsNarrow[month]
130 }
131
132 // MonthsNarrow returns the locales narrow months
133 func (ur *ur) MonthsNarrow() []string {
134         return ur.monthsNarrow[1:]
135 }
136
137 // MonthWide returns the locales wide month given the 'month' provided
138 func (ur *ur) MonthWide(month time.Month) string {
139         return ur.monthsWide[month]
140 }
141
142 // MonthsWide returns the locales wide months
143 func (ur *ur) MonthsWide() []string {
144         return ur.monthsWide[1:]
145 }
146
147 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
148 func (ur *ur) WeekdayAbbreviated(weekday time.Weekday) string {
149         return ur.daysAbbreviated[weekday]
150 }
151
152 // WeekdaysAbbreviated returns the locales abbreviated weekdays
153 func (ur *ur) WeekdaysAbbreviated() []string {
154         return ur.daysAbbreviated
155 }
156
157 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
158 func (ur *ur) WeekdayNarrow(weekday time.Weekday) string {
159         return ur.daysNarrow[weekday]
160 }
161
162 // WeekdaysNarrow returns the locales narrow weekdays
163 func (ur *ur) WeekdaysNarrow() []string {
164         return ur.daysNarrow
165 }
166
167 // WeekdayShort returns the locales short weekday given the 'weekday' provided
168 func (ur *ur) WeekdayShort(weekday time.Weekday) string {
169         return ur.daysShort[weekday]
170 }
171
172 // WeekdaysShort returns the locales short weekdays
173 func (ur *ur) WeekdaysShort() []string {
174         return ur.daysShort
175 }
176
177 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
178 func (ur *ur) WeekdayWide(weekday time.Weekday) string {
179         return ur.daysWide[weekday]
180 }
181
182 // WeekdaysWide returns the locales wide weekdays
183 func (ur *ur) WeekdaysWide() []string {
184         return ur.daysWide
185 }
186
187 // Decimal returns the decimal point of number
188 func (ur *ur) Decimal() string {
189         return ur.decimal
190 }
191
192 // Group returns the group of number
193 func (ur *ur) Group() string {
194         return ur.group
195 }
196
197 // Group returns the minus sign of number
198 func (ur *ur) Minus() string {
199         return ur.minus
200 }
201
202 // FmtNumber returns 'num' with digits/precision of 'v' for 'ur' and handles both Whole and Real numbers based on 'v'
203 func (ur *ur) FmtNumber(num float64, v uint64) string {
204
205         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
206         l := len(s) + 5 + 1*len(s[:len(s)-int(v)-1])/3
207         count := 0
208         inWhole := v == 0
209         b := make([]byte, 0, l)
210
211         for i := len(s) - 1; i >= 0; i-- {
212
213                 if s[i] == '.' {
214                         b = append(b, ur.decimal[0])
215                         inWhole = true
216                         continue
217                 }
218
219                 if inWhole {
220                         if count == 3 {
221                                 b = append(b, ur.group[0])
222                                 count = 1
223                         } else {
224                                 count++
225                         }
226                 }
227
228                 b = append(b, s[i])
229         }
230
231         if num < 0 {
232                 for j := len(ur.minus) - 1; j >= 0; j-- {
233                         b = append(b, ur.minus[j])
234                 }
235         }
236
237         // reverse
238         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
239                 b[i], b[j] = b[j], b[i]
240         }
241
242         return string(b)
243 }
244
245 // FmtPercent returns 'num' with digits/precision of 'v' for 'ur' and handles both Whole and Real numbers based on 'v'
246 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
247 func (ur *ur) FmtPercent(num float64, v uint64) string {
248         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
249         l := len(s) + 6
250         b := make([]byte, 0, l)
251
252         for i := len(s) - 1; i >= 0; i-- {
253
254                 if s[i] == '.' {
255                         b = append(b, ur.decimal[0])
256                         continue
257                 }
258
259                 b = append(b, s[i])
260         }
261
262         if num < 0 {
263                 for j := len(ur.minus) - 1; j >= 0; j-- {
264                         b = append(b, ur.minus[j])
265                 }
266         }
267
268         // reverse
269         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
270                 b[i], b[j] = b[j], b[i]
271         }
272
273         b = append(b, ur.percent...)
274
275         return string(b)
276 }
277
278 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ur'
279 func (ur *ur) FmtCurrency(num float64, v uint64, currency currency.Type) string {
280
281         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
282         symbol := ur.currencies[currency]
283         l := len(s) + len(symbol) + 5 + 1*len(s[:len(s)-int(v)-1])/3
284         count := 0
285         inWhole := v == 0
286         b := make([]byte, 0, l)
287
288         for i := len(s) - 1; i >= 0; i-- {
289
290                 if s[i] == '.' {
291                         b = append(b, ur.decimal[0])
292                         inWhole = true
293                         continue
294                 }
295
296                 if inWhole {
297                         if count == 3 {
298                                 b = append(b, ur.group[0])
299                                 count = 1
300                         } else {
301                                 count++
302                         }
303                 }
304
305                 b = append(b, s[i])
306         }
307
308         for j := len(symbol) - 1; j >= 0; j-- {
309                 b = append(b, symbol[j])
310         }
311
312         if num < 0 {
313                 for j := len(ur.minus) - 1; j >= 0; j-- {
314                         b = append(b, ur.minus[j])
315                 }
316         }
317
318         // reverse
319         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
320                 b[i], b[j] = b[j], b[i]
321         }
322
323         if int(v) < 2 {
324
325                 if v == 0 {
326                         b = append(b, ur.decimal...)
327                 }
328
329                 for i := 0; i < 2-int(v); i++ {
330                         b = append(b, '0')
331                 }
332         }
333
334         return string(b)
335 }
336
337 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ur'
338 // in accounting notation.
339 func (ur *ur) FmtAccounting(num float64, v uint64, currency currency.Type) string {
340
341         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
342         symbol := ur.currencies[currency]
343         l := len(s) + len(symbol) + 5 + 1*len(s[:len(s)-int(v)-1])/3
344         count := 0
345         inWhole := v == 0
346         b := make([]byte, 0, l)
347
348         for i := len(s) - 1; i >= 0; i-- {
349
350                 if s[i] == '.' {
351                         b = append(b, ur.decimal[0])
352                         inWhole = true
353                         continue
354                 }
355
356                 if inWhole {
357                         if count == 3 {
358                                 b = append(b, ur.group[0])
359                                 count = 1
360                         } else {
361                                 count++
362                         }
363                 }
364
365                 b = append(b, s[i])
366         }
367
368         if num < 0 {
369
370                 for j := len(symbol) - 1; j >= 0; j-- {
371                         b = append(b, symbol[j])
372                 }
373
374                 for j := len(ur.minus) - 1; j >= 0; j-- {
375                         b = append(b, ur.minus[j])
376                 }
377
378         } else {
379
380                 for j := len(symbol) - 1; j >= 0; j-- {
381                         b = append(b, symbol[j])
382                 }
383
384         }
385
386         // reverse
387         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
388                 b[i], b[j] = b[j], b[i]
389         }
390
391         if int(v) < 2 {
392
393                 if v == 0 {
394                         b = append(b, ur.decimal...)
395                 }
396
397                 for i := 0; i < 2-int(v); i++ {
398                         b = append(b, '0')
399                 }
400         }
401
402         return string(b)
403 }
404
405 // FmtDateShort returns the short date representation of 't' for 'ur'
406 func (ur *ur) FmtDateShort(t time.Time) string {
407
408         b := make([]byte, 0, 32)
409
410         b = strconv.AppendInt(b, int64(t.Day()), 10)
411         b = append(b, []byte{0x2f}...)
412         b = strconv.AppendInt(b, int64(t.Month()), 10)
413         b = append(b, []byte{0x2f}...)
414
415         if t.Year() > 9 {
416                 b = append(b, strconv.Itoa(t.Year())[2:]...)
417         } else {
418                 b = append(b, strconv.Itoa(t.Year())[1:]...)
419         }
420
421         return string(b)
422 }
423
424 // FmtDateMedium returns the medium date representation of 't' for 'ur'
425 func (ur *ur) FmtDateMedium(t time.Time) string {
426
427         b := make([]byte, 0, 32)
428
429         if t.Year() > 0 {
430                 b = strconv.AppendInt(b, int64(t.Year()), 10)
431         } else {
432                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
433         }
434
435         b = append(b, []byte{0x20}...)
436         b = append(b, ur.monthsAbbreviated[t.Month()]...)
437         b = append(b, []byte{0x20}...)
438         b = strconv.AppendInt(b, int64(t.Day()), 10)
439
440         return string(b)
441 }
442
443 // FmtDateLong returns the long date representation of 't' for 'ur'
444 func (ur *ur) FmtDateLong(t time.Time) string {
445
446         b := make([]byte, 0, 32)
447
448         b = strconv.AppendInt(b, int64(t.Day()), 10)
449         b = append(b, []byte{0x20}...)
450         b = append(b, ur.monthsWide[t.Month()]...)
451         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
452
453         if t.Year() > 0 {
454                 b = strconv.AppendInt(b, int64(t.Year()), 10)
455         } else {
456                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
457         }
458
459         return string(b)
460 }
461
462 // FmtDateFull returns the full date representation of 't' for 'ur'
463 func (ur *ur) FmtDateFull(t time.Time) string {
464
465         b := make([]byte, 0, 32)
466
467         b = append(b, ur.daysWide[t.Weekday()]...)
468         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
469         b = strconv.AppendInt(b, int64(t.Day()), 10)
470         b = append(b, []byte{0x20}...)
471         b = append(b, ur.monthsWide[t.Month()]...)
472         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
473
474         if t.Year() > 0 {
475                 b = strconv.AppendInt(b, int64(t.Year()), 10)
476         } else {
477                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
478         }
479
480         return string(b)
481 }
482
483 // FmtTimeShort returns the short time representation of 't' for 'ur'
484 func (ur *ur) FmtTimeShort(t time.Time) string {
485
486         b := make([]byte, 0, 32)
487
488         h := t.Hour()
489
490         if h > 12 {
491                 h -= 12
492         }
493
494         b = strconv.AppendInt(b, int64(h), 10)
495         b = append(b, ur.timeSeparator...)
496
497         if t.Minute() < 10 {
498                 b = append(b, '0')
499         }
500
501         b = strconv.AppendInt(b, int64(t.Minute()), 10)
502         b = append(b, []byte{0x20}...)
503
504         if t.Hour() < 12 {
505                 b = append(b, ur.periodsAbbreviated[0]...)
506         } else {
507                 b = append(b, ur.periodsAbbreviated[1]...)
508         }
509
510         return string(b)
511 }
512
513 // FmtTimeMedium returns the medium time representation of 't' for 'ur'
514 func (ur *ur) FmtTimeMedium(t time.Time) string {
515
516         b := make([]byte, 0, 32)
517
518         h := t.Hour()
519
520         if h > 12 {
521                 h -= 12
522         }
523
524         b = strconv.AppendInt(b, int64(h), 10)
525         b = append(b, ur.timeSeparator...)
526
527         if t.Minute() < 10 {
528                 b = append(b, '0')
529         }
530
531         b = strconv.AppendInt(b, int64(t.Minute()), 10)
532         b = append(b, ur.timeSeparator...)
533
534         if t.Second() < 10 {
535                 b = append(b, '0')
536         }
537
538         b = strconv.AppendInt(b, int64(t.Second()), 10)
539         b = append(b, []byte{0x20}...)
540
541         if t.Hour() < 12 {
542                 b = append(b, ur.periodsAbbreviated[0]...)
543         } else {
544                 b = append(b, ur.periodsAbbreviated[1]...)
545         }
546
547         return string(b)
548 }
549
550 // FmtTimeLong returns the long time representation of 't' for 'ur'
551 func (ur *ur) FmtTimeLong(t time.Time) string {
552
553         b := make([]byte, 0, 32)
554
555         h := t.Hour()
556
557         if h > 12 {
558                 h -= 12
559         }
560
561         b = strconv.AppendInt(b, int64(h), 10)
562         b = append(b, ur.timeSeparator...)
563
564         if t.Minute() < 10 {
565                 b = append(b, '0')
566         }
567
568         b = strconv.AppendInt(b, int64(t.Minute()), 10)
569         b = append(b, ur.timeSeparator...)
570
571         if t.Second() < 10 {
572                 b = append(b, '0')
573         }
574
575         b = strconv.AppendInt(b, int64(t.Second()), 10)
576         b = append(b, []byte{0x20}...)
577
578         if t.Hour() < 12 {
579                 b = append(b, ur.periodsAbbreviated[0]...)
580         } else {
581                 b = append(b, ur.periodsAbbreviated[1]...)
582         }
583
584         b = append(b, []byte{0x20}...)
585
586         tz, _ := t.Zone()
587         b = append(b, tz...)
588
589         return string(b)
590 }
591
592 // FmtTimeFull returns the full time representation of 't' for 'ur'
593 func (ur *ur) FmtTimeFull(t time.Time) string {
594
595         b := make([]byte, 0, 32)
596
597         h := t.Hour()
598
599         if h > 12 {
600                 h -= 12
601         }
602
603         b = strconv.AppendInt(b, int64(h), 10)
604         b = append(b, ur.timeSeparator...)
605
606         if t.Minute() < 10 {
607                 b = append(b, '0')
608         }
609
610         b = strconv.AppendInt(b, int64(t.Minute()), 10)
611         b = append(b, ur.timeSeparator...)
612
613         if t.Second() < 10 {
614                 b = append(b, '0')
615         }
616
617         b = strconv.AppendInt(b, int64(t.Second()), 10)
618         b = append(b, []byte{0x20}...)
619
620         if t.Hour() < 12 {
621                 b = append(b, ur.periodsAbbreviated[0]...)
622         } else {
623                 b = append(b, ur.periodsAbbreviated[1]...)
624         }
625
626         b = append(b, []byte{0x20}...)
627
628         tz, _ := t.Zone()
629
630         if btz, ok := ur.timezones[tz]; ok {
631                 b = append(b, btz...)
632         } else {
633                 b = append(b, tz...)
634         }
635
636         return string(b)
637 }