ccp.go 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. package ccp
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type ccp 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. perMille string
  19. timeSeparator string
  20. inifinity string
  21. currencies []string // idx = enum of currency code
  22. monthsAbbreviated []string
  23. monthsNarrow []string
  24. monthsWide []string
  25. daysAbbreviated []string
  26. daysNarrow []string
  27. daysShort []string
  28. daysWide []string
  29. periodsAbbreviated []string
  30. periodsNarrow []string
  31. periodsShort []string
  32. periodsWide []string
  33. erasAbbreviated []string
  34. erasNarrow []string
  35. erasWide []string
  36. timezones map[string]string
  37. }
  38. // New returns a new instance of translator for the 'ccp' locale
  39. func New() locales.Translator {
  40. return &ccp{
  41. locale: "ccp",
  42. pluralsCardinal: nil,
  43. pluralsOrdinal: nil,
  44. pluralsRange: nil,
  45. decimal: ".",
  46. percent: "%",
  47. perMille: "‰",
  48. timeSeparator: ":",
  49. inifinity: "∞",
  50. 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", "৳", "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", "CNH", "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", "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", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "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"},
  51. monthsAbbreviated: []string{"", "𑄎𑄚𑄪", "𑄜𑄬𑄛𑄴", "𑄟𑄢𑄴𑄌𑄧", "𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪𑄣𑄭", "𑄃𑄉𑄧𑄌𑄴𑄑𑄴", "𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴", "𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄢𑄴"},
  52. monthsNarrow: []string{"", "𑄎", "𑄜𑄬", "𑄟", "𑄃𑄬", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪", "𑄃", "𑄥𑄬", "𑄃𑄧", "𑄚𑄧", "𑄓𑄨"},
  53. monthsWide: []string{"", "𑄎𑄚𑄪𑄠𑄢𑄨", "𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨", "𑄟𑄢𑄴𑄌𑄧", "𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪𑄣𑄭", "𑄃𑄉𑄧𑄌𑄴𑄑𑄴", "𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄃𑄧𑄇𑄴𑄑𑄬𑄝𑄧𑄢𑄴", "𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴"},
  54. daysAbbreviated: []string{"𑄢𑄧𑄝𑄨", "𑄥𑄧𑄟𑄴", "𑄟𑄧𑄁𑄉𑄧𑄣𑄴", "𑄝𑄪𑄖𑄴", "𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴", "𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴", "𑄥𑄧𑄚𑄨"},
  55. daysNarrow: []string{"𑄢𑄧", "𑄥𑄧", "𑄟𑄧", "𑄝𑄪", "𑄝𑄳𑄢𑄨", "𑄥𑄪", "𑄥𑄧"},
  56. daysWide: []string{"𑄢𑄧𑄝𑄨𑄝𑄢𑄴", "𑄥𑄧𑄟𑄴𑄝𑄢𑄴", "𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴", "𑄝𑄪𑄖𑄴𑄝𑄢𑄴", "𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴", "𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴", "𑄥𑄧𑄚𑄨𑄝𑄢𑄴"},
  57. periodsAbbreviated: []string{"AM", "PM"},
  58. periodsNarrow: []string{"AM", "PM"},
  59. periodsWide: []string{"AM", "PM"},
  60. erasAbbreviated: []string{"", ""},
  61. erasNarrow: []string{"", ""},
  62. erasWide: []string{"", ""},
  63. timezones: map[string]string{"ACST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GYT": "𑄉𑄪𑄠𑄚 𑄃𑄧𑄇𑄴𑄖𑄧", "PDT": "𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEPMX": "𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄚𑄴 𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SAST": "𑄘𑄧𑄉𑄨𑄚𑄴 𑄃𑄜𑄳𑄢𑄨𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SGT": "𑄥𑄨𑄁𑄉𑄛𑄪𑄢 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEEG": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MESZ": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HAT": "𑄚𑄨𑄃𑄪𑄜𑄃𑄪𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MST": "𑄟𑄇𑄃𑄮 𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "TMT": "𑄖𑄪𑄢𑄴𑄇𑄴𑄟𑄬𑄚𑄨𑄌𑄴𑄖𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "BT": "𑄞𑄪𑄑𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNOG": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CLT": "𑄌𑄨𑄣𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CLST": "𑄌𑄨𑄣𑄨 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ChST": "𑄌𑄟𑄬𑄢𑄮 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "JST": "𑄎𑄛𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WAT": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WAST": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MYT": "𑄟𑄣𑄴𑄠𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "LHST": "𑄣𑄧𑄢𑄴𑄓𑄴 𑄦𑄤𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SRT": "𑄥𑄪𑄢𑄨𑄚𑄟𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "OEZ": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CST": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AST": "𑄃𑄑𑄴𑄣𑄚𑄴𑄖𑄨𑄉𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEOG": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNEG": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "UYT": "𑄃𑄪𑄢𑄪𑄉𑄪𑄠𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AEDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄪𑄉𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WEZ": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACWST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACWDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNPMX": "𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄚𑄴 𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "EST": "𑄛𑄪𑄉𑄮 𑄞𑄨𑄘𑄬𑄢𑄴 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HKT": "𑄦𑄧𑄁 𑄇𑄧𑄁 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WART": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "∅∅∅": "𑄛𑄬𑄢𑄪 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNNOMX": "𑄃𑄪𑄖𑄴𑄖𑄮𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄴 𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "TMST": "𑄖𑄪𑄢𑄴𑄇𑄴𑄟𑄬𑄚𑄨𑄌𑄴𑄖𑄚𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AWDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WIT": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "GMT": "𑄉𑄳𑄢𑄨𑄚𑄨𑄌𑄴 𑄟𑄨𑄚𑄴 𑄑𑄬𑄟𑄴", "AKDT": "𑄃𑄣𑄌𑄴𑄇 𑄘𑄨𑄚𑄮𑄃𑄣𑄮 𑄃𑄧𑄇𑄴𑄖𑄧", "HKST": "𑄦𑄧𑄁 𑄇𑄧𑄁 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "NZDT": "𑄚𑄨𑄃𑄪𑄎𑄨𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HENOMX": "𑄃𑄪𑄖𑄴𑄖𑄮𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄴 𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄮𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MDT": "𑄟𑄇𑄃𑄮 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CAT": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄜𑄳𑄢𑄨𑄇 𑄃𑄧𑄇𑄴𑄖𑄧", "EAT": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄃𑄧𑄇𑄴𑄖𑄧", "HNCU": "𑄇𑄨𑄃𑄪𑄝 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "COST": "𑄇𑄧𑄣𑄧𑄟𑄴𑄝𑄨𑄠 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HECU": "𑄇𑄨𑄃𑄪𑄝 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "PST": "𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄞𑄨𑄘𑄬𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNT": "𑄚𑄨𑄃𑄪𑄜𑄃𑄪𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "VET": "𑄞𑄬𑄚𑄬𑄎𑄪𑄠𑄬𑄣 𑄃𑄧𑄇𑄴𑄖𑄧", "WITA": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄢𑄳𑄦 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "HAST": "𑄦𑄧𑄃𑄮𑄠𑄭-𑄃𑄣𑄬𑄃𑄪𑄖𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HADT": "𑄦𑄧𑄃𑄮𑄠𑄭-𑄃𑄣𑄬𑄃𑄪𑄖𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WESZ": "𑄛𑄧𑄏𑄬𑄟𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GFT": "𑄜𑄧𑄢𑄥𑄨 𑄉𑄠𑄚 𑄃𑄧𑄇𑄴𑄖𑄧", "MEZ": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WARST": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ARST": "𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "COT": "𑄇𑄧𑄣𑄧𑄟𑄴𑄝𑄨𑄠 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AWST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ECT": "𑄃𑄨𑄇𑄪𑄠𑄬𑄓𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "OESZ": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ADT": "𑄃𑄑𑄴𑄣𑄚𑄴𑄖𑄨𑄉𑄮𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "BOT": "𑄝𑄮𑄣𑄨𑄞𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "AKST": "𑄃𑄣𑄌𑄴𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "EDT": "𑄛𑄪𑄉𑄮 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "LHDT": "𑄣𑄧𑄢𑄴𑄓𑄴 𑄦𑄤𑄬 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ART": "𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "UYST": "𑄃𑄪𑄢𑄪𑄉𑄪𑄠𑄬 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CHADT": "𑄌𑄳𑄠𑄗𑄟𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "IST": "𑄃𑄨𑄚𑄴𑄘𑄨𑄠𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CDT": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦 𑄘𑄨𑄚𑄮𑄃𑄣𑄮 𑄃𑄧𑄇𑄴𑄖𑄧", "WIB": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "JDT": "𑄎𑄛𑄚𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "NZST": "𑄚𑄨𑄃𑄪𑄎𑄨𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEPM": "𑄥𑄬𑄚𑄴𑄑𑄴 𑄛𑄨𑄠𑄬𑄢𑄴 𑄃𑄮 𑄟𑄨𑄇𑄬𑄣𑄧𑄚𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CHAST": "𑄌𑄳𑄠𑄗𑄟𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNPM": "𑄥𑄬𑄚𑄴𑄑𑄴 𑄛𑄨𑄠𑄬𑄢𑄴 𑄃𑄮 𑄟𑄨𑄇𑄬𑄣𑄧𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AEST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄪𑄉𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧"},
  64. }
  65. }
  66. // Locale returns the current translators string locale
  67. func (ccp *ccp) Locale() string {
  68. return ccp.locale
  69. }
  70. // PluralsCardinal returns the list of cardinal plural rules associated with 'ccp'
  71. func (ccp *ccp) PluralsCardinal() []locales.PluralRule {
  72. return ccp.pluralsCardinal
  73. }
  74. // PluralsOrdinal returns the list of ordinal plural rules associated with 'ccp'
  75. func (ccp *ccp) PluralsOrdinal() []locales.PluralRule {
  76. return ccp.pluralsOrdinal
  77. }
  78. // PluralsRange returns the list of range plural rules associated with 'ccp'
  79. func (ccp *ccp) PluralsRange() []locales.PluralRule {
  80. return ccp.pluralsRange
  81. }
  82. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ccp'
  83. func (ccp *ccp) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  84. return locales.PluralRuleUnknown
  85. }
  86. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ccp'
  87. func (ccp *ccp) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  88. return locales.PluralRuleUnknown
  89. }
  90. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ccp'
  91. func (ccp *ccp) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  92. return locales.PluralRuleUnknown
  93. }
  94. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  95. func (ccp *ccp) MonthAbbreviated(month time.Month) string {
  96. return ccp.monthsAbbreviated[month]
  97. }
  98. // MonthsAbbreviated returns the locales abbreviated months
  99. func (ccp *ccp) MonthsAbbreviated() []string {
  100. return ccp.monthsAbbreviated[1:]
  101. }
  102. // MonthNarrow returns the locales narrow month given the 'month' provided
  103. func (ccp *ccp) MonthNarrow(month time.Month) string {
  104. return ccp.monthsNarrow[month]
  105. }
  106. // MonthsNarrow returns the locales narrow months
  107. func (ccp *ccp) MonthsNarrow() []string {
  108. return ccp.monthsNarrow[1:]
  109. }
  110. // MonthWide returns the locales wide month given the 'month' provided
  111. func (ccp *ccp) MonthWide(month time.Month) string {
  112. return ccp.monthsWide[month]
  113. }
  114. // MonthsWide returns the locales wide months
  115. func (ccp *ccp) MonthsWide() []string {
  116. return ccp.monthsWide[1:]
  117. }
  118. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  119. func (ccp *ccp) WeekdayAbbreviated(weekday time.Weekday) string {
  120. return ccp.daysAbbreviated[weekday]
  121. }
  122. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  123. func (ccp *ccp) WeekdaysAbbreviated() []string {
  124. return ccp.daysAbbreviated
  125. }
  126. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  127. func (ccp *ccp) WeekdayNarrow(weekday time.Weekday) string {
  128. return ccp.daysNarrow[weekday]
  129. }
  130. // WeekdaysNarrow returns the locales narrow weekdays
  131. func (ccp *ccp) WeekdaysNarrow() []string {
  132. return ccp.daysNarrow
  133. }
  134. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  135. func (ccp *ccp) WeekdayShort(weekday time.Weekday) string {
  136. return ccp.daysShort[weekday]
  137. }
  138. // WeekdaysShort returns the locales short weekdays
  139. func (ccp *ccp) WeekdaysShort() []string {
  140. return ccp.daysShort
  141. }
  142. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  143. func (ccp *ccp) WeekdayWide(weekday time.Weekday) string {
  144. return ccp.daysWide[weekday]
  145. }
  146. // WeekdaysWide returns the locales wide weekdays
  147. func (ccp *ccp) WeekdaysWide() []string {
  148. return ccp.daysWide
  149. }
  150. // Decimal returns the decimal point of number
  151. func (ccp *ccp) Decimal() string {
  152. return ccp.decimal
  153. }
  154. // Group returns the group of number
  155. func (ccp *ccp) Group() string {
  156. return ccp.group
  157. }
  158. // Group returns the minus sign of number
  159. func (ccp *ccp) Minus() string {
  160. return ccp.minus
  161. }
  162. // FmtNumber returns 'num' with digits/precision of 'v' for 'ccp' and handles both Whole and Real numbers based on 'v'
  163. func (ccp *ccp) FmtNumber(num float64, v uint64) string {
  164. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  165. l := len(s) + 1
  166. count := 0
  167. inWhole := v == 0
  168. inSecondary := false
  169. groupThreshold := 3
  170. b := make([]byte, 0, l)
  171. for i := len(s) - 1; i >= 0; i-- {
  172. if s[i] == '.' {
  173. b = append(b, ccp.decimal[0])
  174. inWhole = true
  175. continue
  176. }
  177. if inWhole {
  178. if count == groupThreshold {
  179. b = append(b, ccp.group[0])
  180. count = 1
  181. if !inSecondary {
  182. inSecondary = true
  183. groupThreshold = 2
  184. }
  185. } else {
  186. count++
  187. }
  188. }
  189. b = append(b, s[i])
  190. }
  191. if num < 0 {
  192. b = append(b, ccp.minus[0])
  193. }
  194. // reverse
  195. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  196. b[i], b[j] = b[j], b[i]
  197. }
  198. return string(b)
  199. }
  200. // FmtPercent returns 'num' with digits/precision of 'v' for 'ccp' and handles both Whole and Real numbers based on 'v'
  201. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  202. func (ccp *ccp) FmtPercent(num float64, v uint64) string {
  203. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  204. l := len(s) + 2
  205. b := make([]byte, 0, l)
  206. for i := len(s) - 1; i >= 0; i-- {
  207. if s[i] == '.' {
  208. b = append(b, ccp.decimal[0])
  209. continue
  210. }
  211. b = append(b, s[i])
  212. }
  213. if num < 0 {
  214. b = append(b, ccp.minus[0])
  215. }
  216. // reverse
  217. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  218. b[i], b[j] = b[j], b[i]
  219. }
  220. b = append(b, ccp.percent...)
  221. return string(b)
  222. }
  223. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ccp'
  224. func (ccp *ccp) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  225. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  226. symbol := ccp.currencies[currency]
  227. l := len(s) + len(symbol) + 1
  228. count := 0
  229. inWhole := v == 0
  230. inSecondary := false
  231. groupThreshold := 3
  232. b := make([]byte, 0, l)
  233. for i := len(s) - 1; i >= 0; i-- {
  234. if s[i] == '.' {
  235. b = append(b, ccp.decimal[0])
  236. inWhole = true
  237. continue
  238. }
  239. if inWhole {
  240. if count == groupThreshold {
  241. b = append(b, ccp.group[0])
  242. count = 1
  243. if !inSecondary {
  244. inSecondary = true
  245. groupThreshold = 2
  246. }
  247. } else {
  248. count++
  249. }
  250. }
  251. b = append(b, s[i])
  252. }
  253. if num < 0 {
  254. b = append(b, ccp.minus[0])
  255. }
  256. // reverse
  257. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  258. b[i], b[j] = b[j], b[i]
  259. }
  260. if int(v) < 2 {
  261. if v == 0 {
  262. b = append(b, ccp.decimal...)
  263. }
  264. for i := 0; i < 2-int(v); i++ {
  265. b = append(b, '0')
  266. }
  267. }
  268. b = append(b, symbol...)
  269. return string(b)
  270. }
  271. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ccp'
  272. // in accounting notation.
  273. func (ccp *ccp) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  274. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  275. symbol := ccp.currencies[currency]
  276. l := len(s) + len(symbol) + 1
  277. count := 0
  278. inWhole := v == 0
  279. inSecondary := false
  280. groupThreshold := 3
  281. b := make([]byte, 0, l)
  282. for i := len(s) - 1; i >= 0; i-- {
  283. if s[i] == '.' {
  284. b = append(b, ccp.decimal[0])
  285. inWhole = true
  286. continue
  287. }
  288. if inWhole {
  289. if count == groupThreshold {
  290. b = append(b, ccp.group[0])
  291. count = 1
  292. if !inSecondary {
  293. inSecondary = true
  294. groupThreshold = 2
  295. }
  296. } else {
  297. count++
  298. }
  299. }
  300. b = append(b, s[i])
  301. }
  302. if num < 0 {
  303. b = append(b, ccp.minus[0])
  304. }
  305. // reverse
  306. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  307. b[i], b[j] = b[j], b[i]
  308. }
  309. if int(v) < 2 {
  310. if v == 0 {
  311. b = append(b, ccp.decimal...)
  312. }
  313. for i := 0; i < 2-int(v); i++ {
  314. b = append(b, '0')
  315. }
  316. }
  317. if num < 0 {
  318. b = append(b, symbol...)
  319. } else {
  320. b = append(b, symbol...)
  321. }
  322. return string(b)
  323. }
  324. // FmtDateShort returns the short date representation of 't' for 'ccp'
  325. func (ccp *ccp) FmtDateShort(t time.Time) string {
  326. b := make([]byte, 0, 32)
  327. b = strconv.AppendInt(b, int64(t.Day()), 10)
  328. b = append(b, []byte{0x2f}...)
  329. b = strconv.AppendInt(b, int64(t.Month()), 10)
  330. b = append(b, []byte{0x2f}...)
  331. if t.Year() > 9 {
  332. b = append(b, strconv.Itoa(t.Year())[2:]...)
  333. } else {
  334. b = append(b, strconv.Itoa(t.Year())[1:]...)
  335. }
  336. return string(b)
  337. }
  338. // FmtDateMedium returns the medium date representation of 't' for 'ccp'
  339. func (ccp *ccp) FmtDateMedium(t time.Time) string {
  340. b := make([]byte, 0, 32)
  341. b = strconv.AppendInt(b, int64(t.Day()), 10)
  342. b = append(b, []byte{0x20}...)
  343. b = append(b, ccp.monthsAbbreviated[t.Month()]...)
  344. b = append(b, []byte{0x2c, 0x20}...)
  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. // FmtDateLong returns the long date representation of 't' for 'ccp'
  353. func (ccp *ccp) FmtDateLong(t time.Time) string {
  354. b := make([]byte, 0, 32)
  355. b = strconv.AppendInt(b, int64(t.Day()), 10)
  356. b = append(b, []byte{0x20}...)
  357. b = append(b, ccp.monthsWide[t.Month()]...)
  358. b = append(b, []byte{0x2c, 0x20}...)
  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. // FmtDateFull returns the full date representation of 't' for 'ccp'
  367. func (ccp *ccp) FmtDateFull(t time.Time) string {
  368. b := make([]byte, 0, 32)
  369. b = append(b, ccp.daysWide[t.Weekday()]...)
  370. b = append(b, []byte{0x2c, 0x20}...)
  371. b = strconv.AppendInt(b, int64(t.Day()), 10)
  372. b = append(b, []byte{0x20}...)
  373. b = append(b, ccp.monthsWide[t.Month()]...)
  374. b = append(b, []byte{0x2c, 0x20}...)
  375. if t.Year() > 0 {
  376. b = strconv.AppendInt(b, int64(t.Year()), 10)
  377. } else {
  378. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  379. }
  380. return string(b)
  381. }
  382. // FmtTimeShort returns the short time representation of 't' for 'ccp'
  383. func (ccp *ccp) FmtTimeShort(t time.Time) string {
  384. b := make([]byte, 0, 32)
  385. h := t.Hour()
  386. if h > 12 {
  387. h -= 12
  388. }
  389. b = strconv.AppendInt(b, int64(h), 10)
  390. b = append(b, ccp.timeSeparator...)
  391. if t.Minute() < 10 {
  392. b = append(b, '0')
  393. }
  394. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  395. b = append(b, []byte{0x20}...)
  396. if t.Hour() < 12 {
  397. b = append(b, ccp.periodsAbbreviated[0]...)
  398. } else {
  399. b = append(b, ccp.periodsAbbreviated[1]...)
  400. }
  401. return string(b)
  402. }
  403. // FmtTimeMedium returns the medium time representation of 't' for 'ccp'
  404. func (ccp *ccp) FmtTimeMedium(t time.Time) string {
  405. b := make([]byte, 0, 32)
  406. h := t.Hour()
  407. if h > 12 {
  408. h -= 12
  409. }
  410. b = strconv.AppendInt(b, int64(h), 10)
  411. b = append(b, ccp.timeSeparator...)
  412. if t.Minute() < 10 {
  413. b = append(b, '0')
  414. }
  415. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  416. b = append(b, ccp.timeSeparator...)
  417. if t.Second() < 10 {
  418. b = append(b, '0')
  419. }
  420. b = strconv.AppendInt(b, int64(t.Second()), 10)
  421. b = append(b, []byte{0x20}...)
  422. if t.Hour() < 12 {
  423. b = append(b, ccp.periodsAbbreviated[0]...)
  424. } else {
  425. b = append(b, ccp.periodsAbbreviated[1]...)
  426. }
  427. return string(b)
  428. }
  429. // FmtTimeLong returns the long time representation of 't' for 'ccp'
  430. func (ccp *ccp) FmtTimeLong(t time.Time) string {
  431. b := make([]byte, 0, 32)
  432. h := t.Hour()
  433. if h > 12 {
  434. h -= 12
  435. }
  436. b = strconv.AppendInt(b, int64(h), 10)
  437. b = append(b, ccp.timeSeparator...)
  438. if t.Minute() < 10 {
  439. b = append(b, '0')
  440. }
  441. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  442. b = append(b, ccp.timeSeparator...)
  443. if t.Second() < 10 {
  444. b = append(b, '0')
  445. }
  446. b = strconv.AppendInt(b, int64(t.Second()), 10)
  447. b = append(b, []byte{0x20}...)
  448. if t.Hour() < 12 {
  449. b = append(b, ccp.periodsAbbreviated[0]...)
  450. } else {
  451. b = append(b, ccp.periodsAbbreviated[1]...)
  452. }
  453. b = append(b, []byte{0x20}...)
  454. tz, _ := t.Zone()
  455. b = append(b, tz...)
  456. return string(b)
  457. }
  458. // FmtTimeFull returns the full time representation of 't' for 'ccp'
  459. func (ccp *ccp) FmtTimeFull(t time.Time) string {
  460. b := make([]byte, 0, 32)
  461. h := t.Hour()
  462. if h > 12 {
  463. h -= 12
  464. }
  465. b = strconv.AppendInt(b, int64(h), 10)
  466. b = append(b, ccp.timeSeparator...)
  467. if t.Minute() < 10 {
  468. b = append(b, '0')
  469. }
  470. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  471. b = append(b, ccp.timeSeparator...)
  472. if t.Second() < 10 {
  473. b = append(b, '0')
  474. }
  475. b = strconv.AppendInt(b, int64(t.Second()), 10)
  476. b = append(b, []byte{0x20}...)
  477. if t.Hour() < 12 {
  478. b = append(b, ccp.periodsAbbreviated[0]...)
  479. } else {
  480. b = append(b, ccp.periodsAbbreviated[1]...)
  481. }
  482. b = append(b, []byte{0x20}...)
  483. tz, _ := t.Zone()
  484. if btz, ok := ccp.timezones[tz]; ok {
  485. b = append(b, btz...)
  486. } else {
  487. b = append(b, tz...)
  488. }
  489. return string(b)
  490. }