fi_FI.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. package fi_FI
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type fi_FI struct {
  10. locale string
  11. pluralsCardinal []locales.PluralRule
  12. pluralsOrdinal []locales.PluralRule
  13. pluralsRange []locales.PluralRule
  14. decimal string
  15. group string
  16. minus string
  17. percent string
  18. percentSuffix string
  19. perMille string
  20. timeSeparator string
  21. inifinity string
  22. currencies []string // idx = enum of currency code
  23. currencyPositiveSuffix string
  24. currencyNegativeSuffix string
  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. // New returns a new instance of translator for the 'fi_FI' locale
  42. func New() locales.Translator {
  43. return &fi_FI{
  44. locale: "fi_FI",
  45. pluralsCardinal: []locales.PluralRule{2, 6},
  46. pluralsOrdinal: []locales.PluralRule{6},
  47. pluralsRange: []locales.PluralRule{6},
  48. decimal: ",",
  49. group: " ",
  50. minus: "−",
  51. percent: "%",
  52. perMille: "‰",
  53. timeSeparator: ".",
  54. inifinity: "∞",
  55. 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", "CNH", "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", "STN", "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"},
  56. percentSuffix: " ",
  57. currencyPositiveSuffix: " ",
  58. currencyNegativeSuffix: " ",
  59. monthsAbbreviated: []string{"", "tammik.", "helmik.", "maalisk.", "huhtik.", "toukok.", "kesäk.", "heinäk.", "elok.", "syysk.", "lokak.", "marrask.", "jouluk."},
  60. monthsNarrow: []string{"", "T", "H", "M", "H", "T", "K", "H", "E", "S", "L", "M", "J"},
  61. monthsWide: []string{"", "tammikuuta", "helmikuuta", "maaliskuuta", "huhtikuuta", "toukokuuta", "kesäkuuta", "heinäkuuta", "elokuuta", "syyskuuta", "lokakuuta", "marraskuuta", "joulukuuta"},
  62. daysAbbreviated: []string{"su", "ma", "ti", "ke", "to", "pe", "la"},
  63. daysNarrow: []string{"S", "M", "T", "K", "T", "P", "L"},
  64. daysShort: []string{"su", "ma", "ti", "ke", "to", "pe", "la"},
  65. daysWide: []string{"sunnuntaina", "maanantaina", "tiistaina", "keskiviikkona", "torstaina", "perjantaina", "lauantaina"},
  66. periodsAbbreviated: []string{"ap.", "ip."},
  67. periodsNarrow: []string{"ap.", "ip."},
  68. periodsWide: []string{"ap.", "ip."},
  69. erasAbbreviated: []string{"eKr.", "jKr."},
  70. erasNarrow: []string{"eKr", "jKr"},
  71. erasWide: []string{"ennen Kristuksen syntymää", "jälkeen Kristuksen syntymän"},
  72. timezones: map[string]string{"SAST": "Etelä-Afrikan aika", "ECT": "Ecuadorin aika", "TMT": "Turkmenistanin normaaliaika", "PDT": "Yhdysvaltain Tyynenmeren kesäaika", "HEEG": "Itä-Grönlannin kesäaika", "LHST": "Lord Howen normaaliaika", "HNPM": "Saint-Pierren ja Miquelonin normaaliaika", "COT": "Kolumbian normaaliaika", "NZDT": "Uuden-Seelannin kesäaika", "WAT": "Länsi-Afrikan normaaliaika", "GFT": "Ranskan Guayanan aika", "HNT": "Newfoundlandin normaaliaika", "AST": "Kanadan Atlantin normaaliaika", "HKST": "Hongkongin kesäaika", "HADT": "Havaijin-Aleuttien kesäaika", "UYST": "Uruguayn kesäaika", "PST": "Yhdysvaltain Tyynenmeren normaaliaika", "NZST": "Uuden-Seelannin normaaliaika", "MYT": "Malesian aika", "SGT": "Singaporen aika", "HNOG": "Länsi-Grönlannin normaaliaika", "HKT": "Hongkongin normaaliaika", "CLST": "Chilen kesäaika", "AEDT": "Itä-Australian kesäaika", "WART": "Länsi-Argentiinan normaaliaika", "HAT": "Newfoundlandin kesäaika", "EAT": "Itä-Afrikan aika", "HECU": "Kuuban kesäaika", "WESZ": "Länsi-Euroopan kesäaika", "MDT": "Kalliovuorten kesäaika", "HNEG": "Itä-Grönlannin normaaliaika", "HEPM": "Saint-Pierren ja Miquelonin kesäaika", "HENOMX": "Luoteis-Meksikon kesäaika", "WIT": "Itä-Indonesian aika", "ADT": "Kanadan Atlantin kesäaika", "AWST": "Länsi-Australian normaaliaika", "EST": "Yhdysvaltain itäinen normaaliaika", "ACWDT": "Läntisen Keski-Australian kesäaika", "HNNOMX": "Luoteis-Meksikon normaaliaika", "CST": "Yhdysvaltain keskinen normaaliaika", "OEZ": "Itä-Euroopan normaaliaika", "CHAST": "Chathamin normaaliaika", "ACWST": "Läntisen Keski-Australian normaaliaika", "BOT": "Bolivian aika", "WITA": "Keski-Indonesian aika", "∅∅∅": "Acren kesäaika", "MESZ": "Keski-Euroopan kesäaika", "IST": "Intian aika", "HAST": "Havaijin-Aleuttien normaaliaika", "MST": "Kalliovuorten normaaliaika", "HEPMX": "Meksikon Tyynenmeren kesäaika", "WAST": "Länsi-Afrikan kesäaika", "ACDT": "Keski-Australian kesäaika", "MEZ": "Keski-Euroopan normaaliaika", "VET": "Venezuelan aika", "SRT": "Surinamen aika", "OESZ": "Itä-Euroopan kesäaika", "CDT": "Yhdysvaltain keskinen kesäaika", "ARST": "Argentiinan kesäaika", "JDT": "Japanin kesäaika", "HEOG": "Länsi-Grönlannin kesäaika", "ART": "Argentiinan normaaliaika", "HNPMX": "Meksikon Tyynenmeren normaaliaika", "WIB": "Länsi-Indonesian aika", "ACST": "Keski-Australian normaaliaika", "LHDT": "Lord Howen kesäaika", "CAT": "Keski-Afrikan aika", "CLT": "Chilen normaaliaika", "COST": "Kolumbian kesäaika", "ChST": "Tšamorron aika", "AWDT": "Länsi-Australian kesäaika", "HNCU": "Kuuban normaaliaika", "JST": "Japanin normaaliaika", "AKDT": "Alaskan kesäaika", "WARST": "Länsi-Argentiinan kesäaika", "GYT": "Guyanan aika", "UYT": "Uruguayn normaaliaika", "CHADT": "Chathamin kesäaika", "BT": "Bhutanin aika", "WEZ": "Länsi-Euroopan normaaliaika", "AKST": "Alaskan normaaliaika", "EDT": "Yhdysvaltain itäinen kesäaika", "TMST": "Turkmenistanin kesäaika", "GMT": "Greenwichin normaaliaika", "AEST": "Itä-Australian normaaliaika"},
  73. }
  74. }
  75. // Locale returns the current translators string locale
  76. func (fi *fi_FI) Locale() string {
  77. return fi.locale
  78. }
  79. // PluralsCardinal returns the list of cardinal plural rules associated with 'fi_FI'
  80. func (fi *fi_FI) PluralsCardinal() []locales.PluralRule {
  81. return fi.pluralsCardinal
  82. }
  83. // PluralsOrdinal returns the list of ordinal plural rules associated with 'fi_FI'
  84. func (fi *fi_FI) PluralsOrdinal() []locales.PluralRule {
  85. return fi.pluralsOrdinal
  86. }
  87. // PluralsRange returns the list of range plural rules associated with 'fi_FI'
  88. func (fi *fi_FI) PluralsRange() []locales.PluralRule {
  89. return fi.pluralsRange
  90. }
  91. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'fi_FI'
  92. func (fi *fi_FI) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  93. n := math.Abs(num)
  94. i := int64(n)
  95. if i == 1 && v == 0 {
  96. return locales.PluralRuleOne
  97. }
  98. return locales.PluralRuleOther
  99. }
  100. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'fi_FI'
  101. func (fi *fi_FI) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  102. return locales.PluralRuleOther
  103. }
  104. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'fi_FI'
  105. func (fi *fi_FI) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  106. return locales.PluralRuleOther
  107. }
  108. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  109. func (fi *fi_FI) MonthAbbreviated(month time.Month) string {
  110. return fi.monthsAbbreviated[month]
  111. }
  112. // MonthsAbbreviated returns the locales abbreviated months
  113. func (fi *fi_FI) MonthsAbbreviated() []string {
  114. return fi.monthsAbbreviated[1:]
  115. }
  116. // MonthNarrow returns the locales narrow month given the 'month' provided
  117. func (fi *fi_FI) MonthNarrow(month time.Month) string {
  118. return fi.monthsNarrow[month]
  119. }
  120. // MonthsNarrow returns the locales narrow months
  121. func (fi *fi_FI) MonthsNarrow() []string {
  122. return fi.monthsNarrow[1:]
  123. }
  124. // MonthWide returns the locales wide month given the 'month' provided
  125. func (fi *fi_FI) MonthWide(month time.Month) string {
  126. return fi.monthsWide[month]
  127. }
  128. // MonthsWide returns the locales wide months
  129. func (fi *fi_FI) MonthsWide() []string {
  130. return fi.monthsWide[1:]
  131. }
  132. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  133. func (fi *fi_FI) WeekdayAbbreviated(weekday time.Weekday) string {
  134. return fi.daysAbbreviated[weekday]
  135. }
  136. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  137. func (fi *fi_FI) WeekdaysAbbreviated() []string {
  138. return fi.daysAbbreviated
  139. }
  140. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  141. func (fi *fi_FI) WeekdayNarrow(weekday time.Weekday) string {
  142. return fi.daysNarrow[weekday]
  143. }
  144. // WeekdaysNarrow returns the locales narrow weekdays
  145. func (fi *fi_FI) WeekdaysNarrow() []string {
  146. return fi.daysNarrow
  147. }
  148. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  149. func (fi *fi_FI) WeekdayShort(weekday time.Weekday) string {
  150. return fi.daysShort[weekday]
  151. }
  152. // WeekdaysShort returns the locales short weekdays
  153. func (fi *fi_FI) WeekdaysShort() []string {
  154. return fi.daysShort
  155. }
  156. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  157. func (fi *fi_FI) WeekdayWide(weekday time.Weekday) string {
  158. return fi.daysWide[weekday]
  159. }
  160. // WeekdaysWide returns the locales wide weekdays
  161. func (fi *fi_FI) WeekdaysWide() []string {
  162. return fi.daysWide
  163. }
  164. // Decimal returns the decimal point of number
  165. func (fi *fi_FI) Decimal() string {
  166. return fi.decimal
  167. }
  168. // Group returns the group of number
  169. func (fi *fi_FI) Group() string {
  170. return fi.group
  171. }
  172. // Group returns the minus sign of number
  173. func (fi *fi_FI) Minus() string {
  174. return fi.minus
  175. }
  176. // FmtNumber returns 'num' with digits/precision of 'v' for 'fi_FI' and handles both Whole and Real numbers based on 'v'
  177. func (fi *fi_FI) FmtNumber(num float64, v uint64) string {
  178. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  179. l := len(s) + 4 + 2*len(s[:len(s)-int(v)-1])/3
  180. count := 0
  181. inWhole := v == 0
  182. b := make([]byte, 0, l)
  183. for i := len(s) - 1; i >= 0; i-- {
  184. if s[i] == '.' {
  185. b = append(b, fi.decimal[0])
  186. inWhole = true
  187. continue
  188. }
  189. if inWhole {
  190. if count == 3 {
  191. for j := len(fi.group) - 1; j >= 0; j-- {
  192. b = append(b, fi.group[j])
  193. }
  194. count = 1
  195. } else {
  196. count++
  197. }
  198. }
  199. b = append(b, s[i])
  200. }
  201. if num < 0 {
  202. for j := len(fi.minus) - 1; j >= 0; j-- {
  203. b = append(b, fi.minus[j])
  204. }
  205. }
  206. // reverse
  207. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  208. b[i], b[j] = b[j], b[i]
  209. }
  210. return string(b)
  211. }
  212. // FmtPercent returns 'num' with digits/precision of 'v' for 'fi_FI' and handles both Whole and Real numbers based on 'v'
  213. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  214. func (fi *fi_FI) FmtPercent(num float64, v uint64) string {
  215. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  216. l := len(s) + 7
  217. b := make([]byte, 0, l)
  218. for i := len(s) - 1; i >= 0; i-- {
  219. if s[i] == '.' {
  220. b = append(b, fi.decimal[0])
  221. continue
  222. }
  223. b = append(b, s[i])
  224. }
  225. if num < 0 {
  226. for j := len(fi.minus) - 1; j >= 0; j-- {
  227. b = append(b, fi.minus[j])
  228. }
  229. }
  230. // reverse
  231. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  232. b[i], b[j] = b[j], b[i]
  233. }
  234. b = append(b, fi.percentSuffix...)
  235. b = append(b, fi.percent...)
  236. return string(b)
  237. }
  238. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'fi_FI'
  239. func (fi *fi_FI) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  240. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  241. symbol := fi.currencies[currency]
  242. l := len(s) + len(symbol) + 6 + 2*len(s[:len(s)-int(v)-1])/3
  243. count := 0
  244. inWhole := v == 0
  245. b := make([]byte, 0, l)
  246. for i := len(s) - 1; i >= 0; i-- {
  247. if s[i] == '.' {
  248. b = append(b, fi.decimal[0])
  249. inWhole = true
  250. continue
  251. }
  252. if inWhole {
  253. if count == 3 {
  254. for j := len(fi.group) - 1; j >= 0; j-- {
  255. b = append(b, fi.group[j])
  256. }
  257. count = 1
  258. } else {
  259. count++
  260. }
  261. }
  262. b = append(b, s[i])
  263. }
  264. if num < 0 {
  265. for j := len(fi.minus) - 1; j >= 0; j-- {
  266. b = append(b, fi.minus[j])
  267. }
  268. }
  269. // reverse
  270. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  271. b[i], b[j] = b[j], b[i]
  272. }
  273. if int(v) < 2 {
  274. if v == 0 {
  275. b = append(b, fi.decimal...)
  276. }
  277. for i := 0; i < 2-int(v); i++ {
  278. b = append(b, '0')
  279. }
  280. }
  281. b = append(b, fi.currencyPositiveSuffix...)
  282. b = append(b, symbol...)
  283. return string(b)
  284. }
  285. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'fi_FI'
  286. // in accounting notation.
  287. func (fi *fi_FI) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  288. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  289. symbol := fi.currencies[currency]
  290. l := len(s) + len(symbol) + 6 + 2*len(s[:len(s)-int(v)-1])/3
  291. count := 0
  292. inWhole := v == 0
  293. b := make([]byte, 0, l)
  294. for i := len(s) - 1; i >= 0; i-- {
  295. if s[i] == '.' {
  296. b = append(b, fi.decimal[0])
  297. inWhole = true
  298. continue
  299. }
  300. if inWhole {
  301. if count == 3 {
  302. for j := len(fi.group) - 1; j >= 0; j-- {
  303. b = append(b, fi.group[j])
  304. }
  305. count = 1
  306. } else {
  307. count++
  308. }
  309. }
  310. b = append(b, s[i])
  311. }
  312. if num < 0 {
  313. for j := len(fi.minus) - 1; j >= 0; j-- {
  314. b = append(b, fi.minus[j])
  315. }
  316. }
  317. // reverse
  318. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  319. b[i], b[j] = b[j], b[i]
  320. }
  321. if int(v) < 2 {
  322. if v == 0 {
  323. b = append(b, fi.decimal...)
  324. }
  325. for i := 0; i < 2-int(v); i++ {
  326. b = append(b, '0')
  327. }
  328. }
  329. if num < 0 {
  330. b = append(b, fi.currencyNegativeSuffix...)
  331. b = append(b, symbol...)
  332. } else {
  333. b = append(b, fi.currencyPositiveSuffix...)
  334. b = append(b, symbol...)
  335. }
  336. return string(b)
  337. }
  338. // FmtDateShort returns the short date representation of 't' for 'fi_FI'
  339. func (fi *fi_FI) FmtDateShort(t time.Time) string {
  340. b := make([]byte, 0, 32)
  341. b = strconv.AppendInt(b, int64(t.Day()), 10)
  342. b = append(b, []byte{0x2e}...)
  343. b = strconv.AppendInt(b, int64(t.Month()), 10)
  344. b = append(b, []byte{0x2e}...)
  345. if t.Year() > 0 {
  346. b = strconv.AppendInt(b, int64(t.Year()), 10)
  347. } else {
  348. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  349. }
  350. return string(b)
  351. }
  352. // FmtDateMedium returns the medium date representation of 't' for 'fi_FI'
  353. func (fi *fi_FI) FmtDateMedium(t time.Time) string {
  354. b := make([]byte, 0, 32)
  355. b = strconv.AppendInt(b, int64(t.Day()), 10)
  356. b = append(b, []byte{0x2e}...)
  357. b = strconv.AppendInt(b, int64(t.Month()), 10)
  358. b = append(b, []byte{0x2e}...)
  359. if t.Year() > 0 {
  360. b = strconv.AppendInt(b, int64(t.Year()), 10)
  361. } else {
  362. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  363. }
  364. return string(b)
  365. }
  366. // FmtDateLong returns the long date representation of 't' for 'fi_FI'
  367. func (fi *fi_FI) FmtDateLong(t time.Time) string {
  368. b := make([]byte, 0, 32)
  369. b = strconv.AppendInt(b, int64(t.Day()), 10)
  370. b = append(b, []byte{0x2e, 0x20}...)
  371. b = append(b, fi.monthsWide[t.Month()]...)
  372. b = append(b, []byte{0x20}...)
  373. if t.Year() > 0 {
  374. b = strconv.AppendInt(b, int64(t.Year()), 10)
  375. } else {
  376. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  377. }
  378. return string(b)
  379. }
  380. // FmtDateFull returns the full date representation of 't' for 'fi_FI'
  381. func (fi *fi_FI) FmtDateFull(t time.Time) string {
  382. b := make([]byte, 0, 32)
  383. b = append(b, []byte{0x63, 0x63, 0x63, 0x63, 0x20}...)
  384. b = strconv.AppendInt(b, int64(t.Day()), 10)
  385. b = append(b, []byte{0x2e, 0x20}...)
  386. b = append(b, fi.monthsWide[t.Month()]...)
  387. b = append(b, []byte{0x20}...)
  388. if t.Year() > 0 {
  389. b = strconv.AppendInt(b, int64(t.Year()), 10)
  390. } else {
  391. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  392. }
  393. return string(b)
  394. }
  395. // FmtTimeShort returns the short time representation of 't' for 'fi_FI'
  396. func (fi *fi_FI) FmtTimeShort(t time.Time) string {
  397. b := make([]byte, 0, 32)
  398. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  399. b = append(b, []byte{0x2e}...)
  400. if t.Minute() < 10 {
  401. b = append(b, '0')
  402. }
  403. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  404. return string(b)
  405. }
  406. // FmtTimeMedium returns the medium time representation of 't' for 'fi_FI'
  407. func (fi *fi_FI) FmtTimeMedium(t time.Time) string {
  408. b := make([]byte, 0, 32)
  409. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  410. b = append(b, []byte{0x2e}...)
  411. if t.Minute() < 10 {
  412. b = append(b, '0')
  413. }
  414. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  415. b = append(b, []byte{0x2e}...)
  416. if t.Second() < 10 {
  417. b = append(b, '0')
  418. }
  419. b = strconv.AppendInt(b, int64(t.Second()), 10)
  420. return string(b)
  421. }
  422. // FmtTimeLong returns the long time representation of 't' for 'fi_FI'
  423. func (fi *fi_FI) FmtTimeLong(t time.Time) string {
  424. b := make([]byte, 0, 32)
  425. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  426. b = append(b, []byte{0x2e}...)
  427. if t.Minute() < 10 {
  428. b = append(b, '0')
  429. }
  430. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  431. b = append(b, []byte{0x2e}...)
  432. if t.Second() < 10 {
  433. b = append(b, '0')
  434. }
  435. b = strconv.AppendInt(b, int64(t.Second()), 10)
  436. b = append(b, []byte{0x20}...)
  437. tz, _ := t.Zone()
  438. b = append(b, tz...)
  439. return string(b)
  440. }
  441. // FmtTimeFull returns the full time representation of 't' for 'fi_FI'
  442. func (fi *fi_FI) FmtTimeFull(t time.Time) string {
  443. b := make([]byte, 0, 32)
  444. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  445. b = append(b, []byte{0x2e}...)
  446. if t.Minute() < 10 {
  447. b = append(b, '0')
  448. }
  449. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  450. b = append(b, []byte{0x2e}...)
  451. if t.Second() < 10 {
  452. b = append(b, '0')
  453. }
  454. b = strconv.AppendInt(b, int64(t.Second()), 10)
  455. b = append(b, []byte{0x20}...)
  456. tz, _ := t.Zone()
  457. if btz, ok := fi.timezones[tz]; ok {
  458. b = append(b, btz...)
  459. } else {
  460. b = append(b, tz...)
  461. }
  462. return string(b)
  463. }