yo_NG.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. package yo_NG
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type yo_NG 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. currencyNegativePrefix string
  23. currencyNegativeSuffix string
  24. monthsAbbreviated []string
  25. monthsNarrow []string
  26. monthsWide []string
  27. daysAbbreviated []string
  28. daysNarrow []string
  29. daysShort []string
  30. daysWide []string
  31. periodsAbbreviated []string
  32. periodsNarrow []string
  33. periodsShort []string
  34. periodsWide []string
  35. erasAbbreviated []string
  36. erasNarrow []string
  37. erasWide []string
  38. timezones map[string]string
  39. }
  40. // New returns a new instance of translator for the 'yo_NG' locale
  41. func New() locales.Translator {
  42. return &yo_NG{
  43. locale: "yo_NG",
  44. pluralsCardinal: []locales.PluralRule{6},
  45. pluralsOrdinal: nil,
  46. pluralsRange: nil,
  47. timeSeparator: ":",
  48. 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 ", "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 "},
  49. currencyNegativePrefix: "(",
  50. currencyNegativeSuffix: ")",
  51. monthsAbbreviated: []string{"", "Ṣẹ́rẹ́", "Èrèlè", "Ẹrẹ̀nà", "Ìgbé", "Ẹ̀bibi", "Òkúdu", "Agẹmọ", "Ògún", "Owewe", "Ọ̀wàrà", "Bélú", "Ọ̀pẹ̀"},
  52. monthsWide: []string{"", "Oṣù Ṣẹ́rẹ́", "Oṣù Èrèlè", "Oṣù Ẹrẹ̀nà", "Oṣù Ìgbé", "Oṣù Ẹ̀bibi", "Oṣù Òkúdu", "Oṣù Agẹmọ", "Oṣù Ògún", "Oṣù Owewe", "Oṣù Ọ̀wàrà", "Oṣù Bélú", "Oṣù Ọ̀pẹ̀"},
  53. daysAbbreviated: []string{"Àìkú", "Ajé", "Ìsẹ́gun", "Ọjọ́rú", "Ọjọ́bọ", "Ẹtì", "Àbámẹ́ta"},
  54. daysWide: []string{"Ọjọ́ Àìkú", "Ọjọ́ Ajé", "Ọjọ́ Ìsẹ́gun", "Ọjọ́rú", "Ọjọ́bọ", "Ọjọ́ Ẹtì", "Ọjọ́ Àbámẹ́ta"},
  55. periodsAbbreviated: []string{"Àárọ̀", "Ọ̀sán"},
  56. periodsWide: []string{"Àárọ̀", "Ọ̀sán"},
  57. erasAbbreviated: []string{"SK", "LK"},
  58. erasNarrow: []string{"", ""},
  59. erasWide: []string{"Saju Kristi", "Lehin Kristi"},
  60. timezones: map[string]string{"UYST": "UYST", "CLST": "CLST", "HNT": "HNT", "EAT": "EAT", "TMST": "TMST", "AKST": "AKST", "NZDT": "NZDT", "UYT": "UYT", "VET": "VET", "HAST": "HAST", "SAST": "SAST", "OEZ": "OEZ", "AEST": "AEST", "EDT": "EDT", "WAT": "WAT", "WARST": "WARST", "LHST": "LHST", "BOT": "BOT", "WEZ": "WEZ", "WESZ": "WESZ", "COT": "COT", "MST": "MST", "ACDT": "ACDT", "OESZ": "OESZ", "HAT": "HAT", "WITA": "WITA", "SGT": "SGT", "JST": "JST", "MESZ": "MESZ", "CHAST": "CHAST", "ECT": "ECT", "AST": "AST", "PST": "PST", "JDT": "JDT", "NZST": "NZST", "WAST": "WAST", "WART": "WART", "WIT": "WIT", "GYT": "GYT", "SRT": "SRT", "ACWDT": "ACWDT", "ACST": "ACST", "MYT": "MYT", "COST": "COST", "ChST": "ChST", "ADT": "ADT", "BT": "BT", "AEDT": "AEDT", "CAT": "CAT", "WIB": "WIB", "MDT": "MDT", "ARST": "ARST", "AWST": "AWST", "LHDT": "LHDT", "CHADT": "CHADT", "HADT": "HADT", "ART": "ART", "TMT": "TMT", "AWDT": "AWDT", "CDT": "CDT", "ACWST": "ACWST", "HKST": "HKST", "AKDT": "AKDT", "PDT": "PDT", "CST": "CST", "GFT": "GFT", "EST": "EST", "∅∅∅": "∅∅∅", "HKT": "HKT", "IST": "IST", "GMT": "GMT", "MEZ": "MEZ", "CLT": "CLT"},
  61. }
  62. }
  63. // Locale returns the current translators string locale
  64. func (yo *yo_NG) Locale() string {
  65. return yo.locale
  66. }
  67. // PluralsCardinal returns the list of cardinal plural rules associated with 'yo_NG'
  68. func (yo *yo_NG) PluralsCardinal() []locales.PluralRule {
  69. return yo.pluralsCardinal
  70. }
  71. // PluralsOrdinal returns the list of ordinal plural rules associated with 'yo_NG'
  72. func (yo *yo_NG) PluralsOrdinal() []locales.PluralRule {
  73. return yo.pluralsOrdinal
  74. }
  75. // PluralsRange returns the list of range plural rules associated with 'yo_NG'
  76. func (yo *yo_NG) PluralsRange() []locales.PluralRule {
  77. return yo.pluralsRange
  78. }
  79. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'yo_NG'
  80. func (yo *yo_NG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  81. return locales.PluralRuleOther
  82. }
  83. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'yo_NG'
  84. func (yo *yo_NG) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  85. return locales.PluralRuleUnknown
  86. }
  87. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'yo_NG'
  88. func (yo *yo_NG) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  89. return locales.PluralRuleUnknown
  90. }
  91. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  92. func (yo *yo_NG) MonthAbbreviated(month time.Month) string {
  93. return yo.monthsAbbreviated[month]
  94. }
  95. // MonthsAbbreviated returns the locales abbreviated months
  96. func (yo *yo_NG) MonthsAbbreviated() []string {
  97. return yo.monthsAbbreviated[1:]
  98. }
  99. // MonthNarrow returns the locales narrow month given the 'month' provided
  100. func (yo *yo_NG) MonthNarrow(month time.Month) string {
  101. return yo.monthsNarrow[month]
  102. }
  103. // MonthsNarrow returns the locales narrow months
  104. func (yo *yo_NG) MonthsNarrow() []string {
  105. return yo.monthsNarrow[1:]
  106. }
  107. // MonthWide returns the locales wide month given the 'month' provided
  108. func (yo *yo_NG) MonthWide(month time.Month) string {
  109. return yo.monthsWide[month]
  110. }
  111. // MonthsWide returns the locales wide months
  112. func (yo *yo_NG) MonthsWide() []string {
  113. return yo.monthsWide[1:]
  114. }
  115. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  116. func (yo *yo_NG) WeekdayAbbreviated(weekday time.Weekday) string {
  117. return yo.daysAbbreviated[weekday]
  118. }
  119. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  120. func (yo *yo_NG) WeekdaysAbbreviated() []string {
  121. return yo.daysAbbreviated
  122. }
  123. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  124. func (yo *yo_NG) WeekdayNarrow(weekday time.Weekday) string {
  125. return yo.daysNarrow[weekday]
  126. }
  127. // WeekdaysNarrow returns the locales narrow weekdays
  128. func (yo *yo_NG) WeekdaysNarrow() []string {
  129. return yo.daysNarrow
  130. }
  131. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  132. func (yo *yo_NG) WeekdayShort(weekday time.Weekday) string {
  133. return yo.daysShort[weekday]
  134. }
  135. // WeekdaysShort returns the locales short weekdays
  136. func (yo *yo_NG) WeekdaysShort() []string {
  137. return yo.daysShort
  138. }
  139. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  140. func (yo *yo_NG) WeekdayWide(weekday time.Weekday) string {
  141. return yo.daysWide[weekday]
  142. }
  143. // WeekdaysWide returns the locales wide weekdays
  144. func (yo *yo_NG) WeekdaysWide() []string {
  145. return yo.daysWide
  146. }
  147. // FmtNumber returns 'num' with digits/precision of 'v' for 'yo_NG' and handles both Whole and Real numbers based on 'v'
  148. func (yo *yo_NG) FmtNumber(num float64, v uint64) string {
  149. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  150. }
  151. // FmtPercent returns 'num' with digits/precision of 'v' for 'yo_NG' and handles both Whole and Real numbers based on 'v'
  152. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  153. func (yo *yo_NG) FmtPercent(num float64, v uint64) string {
  154. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  155. }
  156. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'yo_NG'
  157. func (yo *yo_NG) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  158. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  159. symbol := yo.currencies[currency]
  160. l := len(s) + len(symbol) + 0 + 0*len(s[:len(s)-int(v)-1])/3
  161. count := 0
  162. inWhole := v == 0
  163. b := make([]byte, 0, l)
  164. for i := len(s) - 1; i >= 0; i-- {
  165. if s[i] == '.' {
  166. b = append(b, yo.decimal[0])
  167. inWhole = true
  168. continue
  169. }
  170. if inWhole {
  171. if count == 3 {
  172. b = append(b, yo.group[0])
  173. count = 1
  174. } else {
  175. count++
  176. }
  177. }
  178. b = append(b, s[i])
  179. }
  180. for j := len(symbol) - 1; j >= 0; j-- {
  181. b = append(b, symbol[j])
  182. }
  183. if num < 0 {
  184. b = append(b, yo.minus[0])
  185. }
  186. // reverse
  187. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  188. b[i], b[j] = b[j], b[i]
  189. }
  190. if int(v) < 2 {
  191. if v == 0 {
  192. b = append(b, yo.decimal...)
  193. }
  194. for i := 0; i < 2-int(v); i++ {
  195. b = append(b, '0')
  196. }
  197. }
  198. return string(b)
  199. }
  200. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'yo_NG'
  201. // in accounting notation.
  202. func (yo *yo_NG) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  203. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  204. symbol := yo.currencies[currency]
  205. l := len(s) + len(symbol) + 2 + 0*len(s[:len(s)-int(v)-1])/3
  206. count := 0
  207. inWhole := v == 0
  208. b := make([]byte, 0, l)
  209. for i := len(s) - 1; i >= 0; i-- {
  210. if s[i] == '.' {
  211. b = append(b, yo.decimal[0])
  212. inWhole = true
  213. continue
  214. }
  215. if inWhole {
  216. if count == 3 {
  217. b = append(b, yo.group[0])
  218. count = 1
  219. } else {
  220. count++
  221. }
  222. }
  223. b = append(b, s[i])
  224. }
  225. if num < 0 {
  226. for j := len(symbol) - 1; j >= 0; j-- {
  227. b = append(b, symbol[j])
  228. }
  229. b = append(b, yo.currencyNegativePrefix[0])
  230. } else {
  231. for j := len(symbol) - 1; j >= 0; j-- {
  232. b = append(b, symbol[j])
  233. }
  234. }
  235. // reverse
  236. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  237. b[i], b[j] = b[j], b[i]
  238. }
  239. if int(v) < 2 {
  240. if v == 0 {
  241. b = append(b, yo.decimal...)
  242. }
  243. for i := 0; i < 2-int(v); i++ {
  244. b = append(b, '0')
  245. }
  246. }
  247. if num < 0 {
  248. b = append(b, yo.currencyNegativeSuffix...)
  249. }
  250. return string(b)
  251. }
  252. // FmtDateShort returns the short date representation of 't' for 'yo_NG'
  253. func (yo *yo_NG) FmtDateShort(t time.Time) string {
  254. b := make([]byte, 0, 32)
  255. if t.Day() < 10 {
  256. b = append(b, '0')
  257. }
  258. b = strconv.AppendInt(b, int64(t.Day()), 10)
  259. b = append(b, []byte{0x2f}...)
  260. if t.Month() < 10 {
  261. b = append(b, '0')
  262. }
  263. b = strconv.AppendInt(b, int64(t.Month()), 10)
  264. b = append(b, []byte{0x2f}...)
  265. b = strconv.AppendInt(b, int64(t.Year()), 10)
  266. return string(b)
  267. }
  268. // FmtDateMedium returns the medium date representation of 't' for 'yo_NG'
  269. func (yo *yo_NG) FmtDateMedium(t time.Time) string {
  270. b := make([]byte, 0, 32)
  271. b = strconv.AppendInt(b, int64(t.Day()), 10)
  272. b = append(b, []byte{0x20}...)
  273. b = append(b, yo.monthsAbbreviated[t.Month()]...)
  274. b = append(b, []byte{0x20}...)
  275. b = strconv.AppendInt(b, int64(t.Year()), 10)
  276. return string(b)
  277. }
  278. // FmtDateLong returns the long date representation of 't' for 'yo_NG'
  279. func (yo *yo_NG) FmtDateLong(t time.Time) string {
  280. b := make([]byte, 0, 32)
  281. b = strconv.AppendInt(b, int64(t.Day()), 10)
  282. b = append(b, []byte{0x20}...)
  283. b = append(b, yo.monthsWide[t.Month()]...)
  284. b = append(b, []byte{0x20}...)
  285. b = strconv.AppendInt(b, int64(t.Year()), 10)
  286. return string(b)
  287. }
  288. // FmtDateFull returns the full date representation of 't' for 'yo_NG'
  289. func (yo *yo_NG) FmtDateFull(t time.Time) string {
  290. b := make([]byte, 0, 32)
  291. b = append(b, yo.daysWide[t.Weekday()]...)
  292. b = append(b, []byte{0x2c, 0x20}...)
  293. b = strconv.AppendInt(b, int64(t.Day()), 10)
  294. b = append(b, []byte{0x20}...)
  295. b = append(b, yo.monthsWide[t.Month()]...)
  296. b = append(b, []byte{0x20}...)
  297. b = strconv.AppendInt(b, int64(t.Year()), 10)
  298. return string(b)
  299. }
  300. // FmtTimeShort returns the short time representation of 't' for 'yo_NG'
  301. func (yo *yo_NG) FmtTimeShort(t time.Time) string {
  302. b := make([]byte, 0, 32)
  303. h := t.Hour()
  304. if h > 12 {
  305. h -= 12
  306. }
  307. b = strconv.AppendInt(b, int64(h), 10)
  308. b = append(b, yo.timeSeparator...)
  309. if t.Minute() < 10 {
  310. b = append(b, '0')
  311. }
  312. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  313. b = append(b, []byte{0x20}...)
  314. if t.Hour() < 12 {
  315. b = append(b, yo.periodsAbbreviated[0]...)
  316. } else {
  317. b = append(b, yo.periodsAbbreviated[1]...)
  318. }
  319. return string(b)
  320. }
  321. // FmtTimeMedium returns the medium time representation of 't' for 'yo_NG'
  322. func (yo *yo_NG) FmtTimeMedium(t time.Time) string {
  323. b := make([]byte, 0, 32)
  324. h := t.Hour()
  325. if h > 12 {
  326. h -= 12
  327. }
  328. b = strconv.AppendInt(b, int64(h), 10)
  329. b = append(b, yo.timeSeparator...)
  330. if t.Minute() < 10 {
  331. b = append(b, '0')
  332. }
  333. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  334. b = append(b, yo.timeSeparator...)
  335. if t.Second() < 10 {
  336. b = append(b, '0')
  337. }
  338. b = strconv.AppendInt(b, int64(t.Second()), 10)
  339. b = append(b, []byte{0x20}...)
  340. if t.Hour() < 12 {
  341. b = append(b, yo.periodsAbbreviated[0]...)
  342. } else {
  343. b = append(b, yo.periodsAbbreviated[1]...)
  344. }
  345. return string(b)
  346. }
  347. // FmtTimeLong returns the long time representation of 't' for 'yo_NG'
  348. func (yo *yo_NG) FmtTimeLong(t time.Time) string {
  349. b := make([]byte, 0, 32)
  350. h := t.Hour()
  351. if h > 12 {
  352. h -= 12
  353. }
  354. b = strconv.AppendInt(b, int64(h), 10)
  355. b = append(b, yo.timeSeparator...)
  356. if t.Minute() < 10 {
  357. b = append(b, '0')
  358. }
  359. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  360. b = append(b, yo.timeSeparator...)
  361. if t.Second() < 10 {
  362. b = append(b, '0')
  363. }
  364. b = strconv.AppendInt(b, int64(t.Second()), 10)
  365. b = append(b, []byte{0x20}...)
  366. if t.Hour() < 12 {
  367. b = append(b, yo.periodsAbbreviated[0]...)
  368. } else {
  369. b = append(b, yo.periodsAbbreviated[1]...)
  370. }
  371. b = append(b, []byte{0x20}...)
  372. tz, _ := t.Zone()
  373. b = append(b, tz...)
  374. return string(b)
  375. }
  376. // FmtTimeFull returns the full time representation of 't' for 'yo_NG'
  377. func (yo *yo_NG) FmtTimeFull(t time.Time) string {
  378. b := make([]byte, 0, 32)
  379. h := t.Hour()
  380. if h > 12 {
  381. h -= 12
  382. }
  383. b = strconv.AppendInt(b, int64(h), 10)
  384. b = append(b, yo.timeSeparator...)
  385. if t.Minute() < 10 {
  386. b = append(b, '0')
  387. }
  388. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  389. b = append(b, yo.timeSeparator...)
  390. if t.Second() < 10 {
  391. b = append(b, '0')
  392. }
  393. b = strconv.AppendInt(b, int64(t.Second()), 10)
  394. b = append(b, []byte{0x20}...)
  395. if t.Hour() < 12 {
  396. b = append(b, yo.periodsAbbreviated[0]...)
  397. } else {
  398. b = append(b, yo.periodsAbbreviated[1]...)
  399. }
  400. b = append(b, []byte{0x20}...)
  401. tz, _ := t.Zone()
  402. if btz, ok := yo.timezones[tz]; ok {
  403. b = append(b, btz...)
  404. } else {
  405. b = append(b, tz...)
  406. }
  407. return string(b)
  408. }