...

Source file src/github.com/go-playground/locales/uz_Arab/uz_Arab.go

Documentation: github.com/go-playground/locales/uz_Arab

     1  package uz_Arab
     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 uz_Arab 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  	currencyPositiveSuffix string
    26  	currencyNegativeSuffix string
    27  	monthsAbbreviated      []string
    28  	monthsNarrow           []string
    29  	monthsWide             []string
    30  	daysAbbreviated        []string
    31  	daysNarrow             []string
    32  	daysShort              []string
    33  	daysWide               []string
    34  	periodsAbbreviated     []string
    35  	periodsNarrow          []string
    36  	periodsShort           []string
    37  	periodsWide            []string
    38  	erasAbbreviated        []string
    39  	erasNarrow             []string
    40  	erasWide               []string
    41  	timezones              map[string]string
    42  }
    43  
    44  // New returns a new instance of translator for the 'uz_Arab' locale
    45  func New() locales.Translator {
    46  	return &uz_Arab{
    47  		locale:                 "uz_Arab",
    48  		pluralsCardinal:        []locales.PluralRule{2, 6},
    49  		pluralsOrdinal:         []locales.PluralRule{6},
    50  		pluralsRange:           []locales.PluralRule{2, 6},
    51  		decimal:                "٫",
    52  		group:                  "٬",
    53  		minus:                  "-",
    54  		percent:                "٪",
    55  		perMille:               "‰",
    56  		timeSeparator:          ":",
    57  		inifinity:              "∞",
    58  		currencies:             []string{"ADP", "AED", "AFA", "؋", "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", "MRU", "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", "UYW", "UZS", "VEB", "VEF", "VES", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
    59  		currencyPositiveSuffix: " ",
    60  		currencyNegativeSuffix: " ",
    61  		monthsAbbreviated:      []string{"", "جنو", "فبر", "مار", "اپر", "می", "جون", "جول", "اگس", "سپت", "اکت", "نوم", "دسم"},
    62  		monthsNarrow:           []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
    63  		monthsWide:             []string{"", "جنوری", "فبروری", "مارچ", "اپریل", "می", "جون", "جولای", "اگست", "سپتمبر", "اکتوبر", "نومبر", "دسمبر"},
    64  		daysAbbreviated:        []string{"ی.", "د.", "س.", "چ.", "پ.", "ج.", "ش."},
    65  		daysNarrow:             []string{"S", "M", "T", "W", "T", "F", "S"},
    66  		daysShort:              []string{"Ya", "Du", "Se", "Ch", "Pa", "Ju", "Sh"},
    67  		daysWide:               []string{"یکشنبه", "دوشنبه", "سه\u200cشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"},
    68  		periodsAbbreviated:     []string{"AM", "PM"},
    69  		periodsNarrow:          []string{"", ""},
    70  		periodsWide:            []string{"", ""},
    71  		erasAbbreviated:        []string{"ق.م.", "م."},
    72  		erasNarrow:             []string{"", ""},
    73  		erasWide:               []string{"", ""},
    74  		timezones:              map[string]string{"ACDT": "Markaziy Avstraliya yozgi vaqti", "ACST": "Markaziy Avstraliya standart vaqti", "ACWDT": "Markaziy Avstraliya g‘arbiy yozgi vaqti", "ACWST": "Markaziy Avstraliya g‘arbiy standart vaqti", "ADT": "Atlantika yozgi vaqti", "AEDT": "Sharqiy Avstraliya yozgi vaqti", "AEST": "Sharqiy Avstraliya standart vaqti", "AKDT": "Alyaska yozgi vaqti", "AKST": "Alyaska standart vaqti", "ARST": "Argentina yozgi vaqti", "ART": "Argentina standart vaqti", "AST": "Atlantika standart vaqti", "AWDT": "G‘arbiy Avstraliya yozgi vaqti", "AWST": "G‘arbiy Avstraliya standart vaqti", "BOT": "Boliviya vaqti", "BT": "Butan vaqti", "CAT": "Markaziy Afrika vaqti", "CDT": "Markaziy Amerika yozgi vaqti", "CHADT": "Chatem yozgi vaqti", "CHAST": "Chatem standart vaqti", "CLST": "Chili yozgi vaqti", "CLT": "Chili standart vaqti", "COST": "Kolumbiya yozgi vaqti", "COT": "Kolumbiya standart vaqti", "CST": "Markaziy Amerika standart vaqti", "ChST": "Chamorro standart vaqti", "EAT": "Sharqiy Afrika vaqti", "ECT": "Ekvador vaqti", "EDT": "Sharqiy Amerika yozgi vaqti", "EST": "Sharqiy Amerika standart vaqti", "GFT": "Fransuz Gvianasi vaqti", "GMT": "Grinvich o‘rtacha vaqti", "GST": "Fors ko‘rfazi standart vaqti", "GYT": "Gayana vaqti", "HADT": "Gavayi-aleut yozgi vaqti", "HAST": "Gavayi-aleut standart vaqti", "HAT": "Nyufaundlend yozgi vaqti", "HECU": "Kuba yozgi vaqti", "HEEG": "Sharqiy Grenlandiya yozgi vaqti", "HENOMX": "Shimoli-g‘arbiy Meksika yozgi vaqti", "HEOG": "G‘arbiy Grenlandiya yozgi vaqti", "HEPM": "Sen-Pyer va Mikelon yozgi vaqti", "HEPMX": "Meksika Tinch okeani yozgi vaqti", "HKST": "Gonkong yozgi vaqti", "HKT": "Gonkong standart vaqti", "HNCU": "Kuba standart vaqti", "HNEG": "Sharqiy Grenlandiya standart vaqti", "HNNOMX": "Shimoli-g‘arbiy Meksika standart vaqti", "HNOG": "G‘arbiy Grenlandiya standart vaqti", "HNPM": "Sen-Pyer va Mikelon standart vaqti", "HNPMX": "Meksika Tinch okeani standart vaqti", "HNT": "Nyufaundlend standart vaqti", "IST": "Hindiston standart vaqti", "JDT": "Yaponiya yozgi vaqti", "JST": "Yaponiya standart vaqti", "LHDT": "Lord-Xau yozgi vaqti", "LHST": "Lord-Xau standart vaqti", "MDT": "Tog‘ yozgi vaqti (AQSH)", "MESZ": "Markaziy Yevropa yozgi vaqti", "MEZ": "Markaziy Yevropa standart vaqti", "MST": "Tog‘ standart vaqti (AQSH)", "MYT": "Malayziya vaqti", "NZDT": "Yangi Zelandiya yozgi vaqti", "NZST": "Yangi Zelandiya standart vaqti", "OESZ": "Sharqiy Yevropa yozgi vaqti", "OEZ": "Sharqiy Yevropa standart vaqti", "PDT": "Tinch okeani yozgi vaqti", "PST": "Tinch okeani standart vaqti", "SAST": "Janubiy Afrika standart vaqti", "SGT": "Singapur vaqti", "SRT": "Surinam vaqti", "TMST": "Turkmaniston yozgi vaqti", "TMT": "Turkmaniston standart vaqti", "UYST": "Urugvay yozgi vaqti", "UYT": "Urugvay standart vaqti", "VET": "Venesuela vaqti", "WARST": "Gʻarbiy Argentina yozgi vaqti", "WART": "Gʻarbiy Argentina standart vaqti", "WAST": "Gʻarbiy Afrika yozgi vaqti", "WAT": "Gʻarbiy Afrika standart vaqti", "WESZ": "G‘arbiy Yevropa yozgi vaqti", "WEZ": "G‘arbiy Yevropa standart vaqti", "WIB": "Gʻarbiy Indoneziya vaqti", "WIT": "Sharqiy Indoneziya vaqti", "WITA": "Markaziy Indoneziya vaqti", "∅∅∅": "Azor orollari yozgi vaqti"},
    75  	}
    76  }
    77  
    78  // Locale returns the current translators string locale
    79  func (uz *uz_Arab) Locale() string {
    80  	return uz.locale
    81  }
    82  
    83  // PluralsCardinal returns the list of cardinal plural rules associated with 'uz_Arab'
    84  func (uz *uz_Arab) PluralsCardinal() []locales.PluralRule {
    85  	return uz.pluralsCardinal
    86  }
    87  
    88  // PluralsOrdinal returns the list of ordinal plural rules associated with 'uz_Arab'
    89  func (uz *uz_Arab) PluralsOrdinal() []locales.PluralRule {
    90  	return uz.pluralsOrdinal
    91  }
    92  
    93  // PluralsRange returns the list of range plural rules associated with 'uz_Arab'
    94  func (uz *uz_Arab) PluralsRange() []locales.PluralRule {
    95  	return uz.pluralsRange
    96  }
    97  
    98  // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'uz_Arab'
    99  func (uz *uz_Arab) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
   100  
   101  	n := math.Abs(num)
   102  
   103  	if n == 1 {
   104  		return locales.PluralRuleOne
   105  	}
   106  
   107  	return locales.PluralRuleOther
   108  }
   109  
   110  // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'uz_Arab'
   111  func (uz *uz_Arab) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
   112  	return locales.PluralRuleOther
   113  }
   114  
   115  // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'uz_Arab'
   116  func (uz *uz_Arab) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
   117  
   118  	start := uz.CardinalPluralRule(num1, v1)
   119  	end := uz.CardinalPluralRule(num2, v2)
   120  
   121  	if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
   122  		return locales.PluralRuleOther
   123  	} else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
   124  		return locales.PluralRuleOne
   125  	}
   126  
   127  	return locales.PluralRuleOther
   128  
   129  }
   130  
   131  // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
   132  func (uz *uz_Arab) MonthAbbreviated(month time.Month) string {
   133  	return uz.monthsAbbreviated[month]
   134  }
   135  
   136  // MonthsAbbreviated returns the locales abbreviated months
   137  func (uz *uz_Arab) MonthsAbbreviated() []string {
   138  	return uz.monthsAbbreviated[1:]
   139  }
   140  
   141  // MonthNarrow returns the locales narrow month given the 'month' provided
   142  func (uz *uz_Arab) MonthNarrow(month time.Month) string {
   143  	return uz.monthsNarrow[month]
   144  }
   145  
   146  // MonthsNarrow returns the locales narrow months
   147  func (uz *uz_Arab) MonthsNarrow() []string {
   148  	return uz.monthsNarrow[1:]
   149  }
   150  
   151  // MonthWide returns the locales wide month given the 'month' provided
   152  func (uz *uz_Arab) MonthWide(month time.Month) string {
   153  	return uz.monthsWide[month]
   154  }
   155  
   156  // MonthsWide returns the locales wide months
   157  func (uz *uz_Arab) MonthsWide() []string {
   158  	return uz.monthsWide[1:]
   159  }
   160  
   161  // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
   162  func (uz *uz_Arab) WeekdayAbbreviated(weekday time.Weekday) string {
   163  	return uz.daysAbbreviated[weekday]
   164  }
   165  
   166  // WeekdaysAbbreviated returns the locales abbreviated weekdays
   167  func (uz *uz_Arab) WeekdaysAbbreviated() []string {
   168  	return uz.daysAbbreviated
   169  }
   170  
   171  // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
   172  func (uz *uz_Arab) WeekdayNarrow(weekday time.Weekday) string {
   173  	return uz.daysNarrow[weekday]
   174  }
   175  
   176  // WeekdaysNarrow returns the locales narrow weekdays
   177  func (uz *uz_Arab) WeekdaysNarrow() []string {
   178  	return uz.daysNarrow
   179  }
   180  
   181  // WeekdayShort returns the locales short weekday given the 'weekday' provided
   182  func (uz *uz_Arab) WeekdayShort(weekday time.Weekday) string {
   183  	return uz.daysShort[weekday]
   184  }
   185  
   186  // WeekdaysShort returns the locales short weekdays
   187  func (uz *uz_Arab) WeekdaysShort() []string {
   188  	return uz.daysShort
   189  }
   190  
   191  // WeekdayWide returns the locales wide weekday given the 'weekday' provided
   192  func (uz *uz_Arab) WeekdayWide(weekday time.Weekday) string {
   193  	return uz.daysWide[weekday]
   194  }
   195  
   196  // WeekdaysWide returns the locales wide weekdays
   197  func (uz *uz_Arab) WeekdaysWide() []string {
   198  	return uz.daysWide
   199  }
   200  
   201  // Decimal returns the decimal point of number
   202  func (uz *uz_Arab) Decimal() string {
   203  	return uz.decimal
   204  }
   205  
   206  // Group returns the group of number
   207  func (uz *uz_Arab) Group() string {
   208  	return uz.group
   209  }
   210  
   211  // Group returns the minus sign of number
   212  func (uz *uz_Arab) Minus() string {
   213  	return uz.minus
   214  }
   215  
   216  // FmtNumber returns 'num' with digits/precision of 'v' for 'uz_Arab' and handles both Whole and Real numbers based on 'v'
   217  func (uz *uz_Arab) FmtNumber(num float64, v uint64) string {
   218  
   219  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   220  	l := len(s) + 3 + 2*len(s[:len(s)-int(v)-1])/3
   221  	count := 0
   222  	inWhole := v == 0
   223  	b := make([]byte, 0, l)
   224  
   225  	for i := len(s) - 1; i >= 0; i-- {
   226  
   227  		if s[i] == '.' {
   228  			for j := len(uz.decimal) - 1; j >= 0; j-- {
   229  				b = append(b, uz.decimal[j])
   230  			}
   231  			inWhole = true
   232  			continue
   233  		}
   234  
   235  		if inWhole {
   236  			if count == 3 {
   237  				for j := len(uz.group) - 1; j >= 0; j-- {
   238  					b = append(b, uz.group[j])
   239  				}
   240  				count = 1
   241  			} else {
   242  				count++
   243  			}
   244  		}
   245  
   246  		b = append(b, s[i])
   247  	}
   248  
   249  	if num < 0 {
   250  		b = append(b, uz.minus[0])
   251  	}
   252  
   253  	// reverse
   254  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   255  		b[i], b[j] = b[j], b[i]
   256  	}
   257  
   258  	return string(b)
   259  }
   260  
   261  // FmtPercent returns 'num' with digits/precision of 'v' for 'uz_Arab' and handles both Whole and Real numbers based on 'v'
   262  // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
   263  func (uz *uz_Arab) FmtPercent(num float64, v uint64) string {
   264  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   265  	l := len(s) + 5
   266  	b := make([]byte, 0, l)
   267  
   268  	for i := len(s) - 1; i >= 0; i-- {
   269  
   270  		if s[i] == '.' {
   271  			for j := len(uz.decimal) - 1; j >= 0; j-- {
   272  				b = append(b, uz.decimal[j])
   273  			}
   274  			continue
   275  		}
   276  
   277  		b = append(b, s[i])
   278  	}
   279  
   280  	if num < 0 {
   281  		b = append(b, uz.minus[0])
   282  	}
   283  
   284  	// reverse
   285  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   286  		b[i], b[j] = b[j], b[i]
   287  	}
   288  
   289  	b = append(b, uz.percent...)
   290  
   291  	return string(b)
   292  }
   293  
   294  // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'uz_Arab'
   295  func (uz *uz_Arab) FmtCurrency(num float64, v uint64, currency currency.Type) string {
   296  
   297  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   298  	symbol := uz.currencies[currency]
   299  	l := len(s) + len(symbol) + 5 + 2*len(s[:len(s)-int(v)-1])/3
   300  	count := 0
   301  	inWhole := v == 0
   302  	b := make([]byte, 0, l)
   303  
   304  	for i := len(s) - 1; i >= 0; i-- {
   305  
   306  		if s[i] == '.' {
   307  			for j := len(uz.decimal) - 1; j >= 0; j-- {
   308  				b = append(b, uz.decimal[j])
   309  			}
   310  			inWhole = true
   311  			continue
   312  		}
   313  
   314  		if inWhole {
   315  			if count == 3 {
   316  				for j := len(uz.group) - 1; j >= 0; j-- {
   317  					b = append(b, uz.group[j])
   318  				}
   319  				count = 1
   320  			} else {
   321  				count++
   322  			}
   323  		}
   324  
   325  		b = append(b, s[i])
   326  	}
   327  
   328  	if num < 0 {
   329  		b = append(b, uz.minus[0])
   330  	}
   331  
   332  	// reverse
   333  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   334  		b[i], b[j] = b[j], b[i]
   335  	}
   336  
   337  	if int(v) < 2 {
   338  
   339  		if v == 0 {
   340  			b = append(b, uz.decimal...)
   341  		}
   342  
   343  		for i := 0; i < 2-int(v); i++ {
   344  			b = append(b, '0')
   345  		}
   346  	}
   347  
   348  	b = append(b, uz.currencyPositiveSuffix...)
   349  
   350  	b = append(b, symbol...)
   351  
   352  	return string(b)
   353  }
   354  
   355  // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'uz_Arab'
   356  // in accounting notation.
   357  func (uz *uz_Arab) FmtAccounting(num float64, v uint64, currency currency.Type) string {
   358  
   359  	s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
   360  	symbol := uz.currencies[currency]
   361  	l := len(s) + len(symbol) + 5 + 2*len(s[:len(s)-int(v)-1])/3
   362  	count := 0
   363  	inWhole := v == 0
   364  	b := make([]byte, 0, l)
   365  
   366  	for i := len(s) - 1; i >= 0; i-- {
   367  
   368  		if s[i] == '.' {
   369  			for j := len(uz.decimal) - 1; j >= 0; j-- {
   370  				b = append(b, uz.decimal[j])
   371  			}
   372  			inWhole = true
   373  			continue
   374  		}
   375  
   376  		if inWhole {
   377  			if count == 3 {
   378  				for j := len(uz.group) - 1; j >= 0; j-- {
   379  					b = append(b, uz.group[j])
   380  				}
   381  				count = 1
   382  			} else {
   383  				count++
   384  			}
   385  		}
   386  
   387  		b = append(b, s[i])
   388  	}
   389  
   390  	if num < 0 {
   391  
   392  		b = append(b, uz.minus[0])
   393  
   394  	}
   395  
   396  	// reverse
   397  	for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
   398  		b[i], b[j] = b[j], b[i]
   399  	}
   400  
   401  	if int(v) < 2 {
   402  
   403  		if v == 0 {
   404  			b = append(b, uz.decimal...)
   405  		}
   406  
   407  		for i := 0; i < 2-int(v); i++ {
   408  			b = append(b, '0')
   409  		}
   410  	}
   411  
   412  	if num < 0 {
   413  		b = append(b, uz.currencyNegativeSuffix...)
   414  		b = append(b, symbol...)
   415  	} else {
   416  
   417  		b = append(b, uz.currencyPositiveSuffix...)
   418  		b = append(b, symbol...)
   419  	}
   420  
   421  	return string(b)
   422  }
   423  
   424  // FmtDateShort returns the short date representation of 't' for 'uz_Arab'
   425  func (uz *uz_Arab) FmtDateShort(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{0x2f}...)
   436  	b = strconv.AppendInt(b, int64(t.Month()), 10)
   437  	b = append(b, []byte{0x2f}...)
   438  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   439  
   440  	return string(b)
   441  }
   442  
   443  // FmtDateMedium returns the medium date representation of 't' for 'uz_Arab'
   444  func (uz *uz_Arab) FmtDateMedium(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, uz.monthsAbbreviated[t.Month()]...)
   451  	b = append(b, []byte{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  // FmtDateLong returns the long date representation of 't' for 'uz_Arab'
   463  func (uz *uz_Arab) FmtDateLong(t time.Time) string {
   464  
   465  	b := make([]byte, 0, 32)
   466  
   467  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   468  	b = append(b, []byte{0x20, 0xd9, 0x86, 0xda, 0x86, 0xdb, 0x8c, 0x20}...)
   469  	b = append(b, uz.monthsWide[t.Month()]...)
   470  	b = append(b, []byte{0x20}...)
   471  
   472  	if t.Year() > 0 {
   473  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   474  	} else {
   475  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   476  	}
   477  
   478  	return string(b)
   479  }
   480  
   481  // FmtDateFull returns the full date representation of 't' for 'uz_Arab'
   482  func (uz *uz_Arab) FmtDateFull(t time.Time) string {
   483  
   484  	b := make([]byte, 0, 32)
   485  
   486  	if t.Year() > 0 {
   487  		b = strconv.AppendInt(b, int64(t.Year()), 10)
   488  	} else {
   489  		b = strconv.AppendInt(b, int64(-t.Year()), 10)
   490  	}
   491  
   492  	b = append(b, []byte{0x20, 0xd9, 0x86, 0xda, 0x86, 0xdb, 0x8c, 0x20, 0xdb, 0x8c, 0xdb, 0x8c, 0xd9, 0x84, 0x20}...)
   493  	b = strconv.AppendInt(b, int64(t.Day()), 10)
   494  	b = append(b, []byte{0x20, 0xd9, 0x86, 0xda, 0x86, 0xdb, 0x8c, 0x20}...)
   495  	b = append(b, uz.monthsWide[t.Month()]...)
   496  	b = append(b, []byte{0x20}...)
   497  	b = append(b, uz.daysWide[t.Weekday()]...)
   498  	b = append(b, []byte{0x20, 0xda, 0xa9, 0xd9, 0x88, 0xd9, 0x86, 0xdb, 0x8c}...)
   499  
   500  	return string(b)
   501  }
   502  
   503  // FmtTimeShort returns the short time representation of 't' for 'uz_Arab'
   504  func (uz *uz_Arab) FmtTimeShort(t time.Time) string {
   505  
   506  	b := make([]byte, 0, 32)
   507  
   508  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   509  	b = append(b, uz.timeSeparator...)
   510  
   511  	if t.Minute() < 10 {
   512  		b = append(b, '0')
   513  	}
   514  
   515  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   516  
   517  	return string(b)
   518  }
   519  
   520  // FmtTimeMedium returns the medium time representation of 't' for 'uz_Arab'
   521  func (uz *uz_Arab) FmtTimeMedium(t time.Time) string {
   522  
   523  	b := make([]byte, 0, 32)
   524  
   525  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   526  	b = append(b, uz.timeSeparator...)
   527  
   528  	if t.Minute() < 10 {
   529  		b = append(b, '0')
   530  	}
   531  
   532  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   533  	b = append(b, uz.timeSeparator...)
   534  
   535  	if t.Second() < 10 {
   536  		b = append(b, '0')
   537  	}
   538  
   539  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   540  
   541  	return string(b)
   542  }
   543  
   544  // FmtTimeLong returns the long time representation of 't' for 'uz_Arab'
   545  func (uz *uz_Arab) FmtTimeLong(t time.Time) string {
   546  
   547  	b := make([]byte, 0, 32)
   548  
   549  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   550  	b = append(b, uz.timeSeparator...)
   551  
   552  	if t.Minute() < 10 {
   553  		b = append(b, '0')
   554  	}
   555  
   556  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   557  	b = append(b, uz.timeSeparator...)
   558  
   559  	if t.Second() < 10 {
   560  		b = append(b, '0')
   561  	}
   562  
   563  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   564  	b = append(b, []byte{0x20, 0x28}...)
   565  
   566  	tz, _ := t.Zone()
   567  	b = append(b, tz...)
   568  
   569  	b = append(b, []byte{0x29}...)
   570  
   571  	return string(b)
   572  }
   573  
   574  // FmtTimeFull returns the full time representation of 't' for 'uz_Arab'
   575  func (uz *uz_Arab) FmtTimeFull(t time.Time) string {
   576  
   577  	b := make([]byte, 0, 32)
   578  
   579  	b = strconv.AppendInt(b, int64(t.Hour()), 10)
   580  	b = append(b, uz.timeSeparator...)
   581  
   582  	if t.Minute() < 10 {
   583  		b = append(b, '0')
   584  	}
   585  
   586  	b = strconv.AppendInt(b, int64(t.Minute()), 10)
   587  	b = append(b, uz.timeSeparator...)
   588  
   589  	if t.Second() < 10 {
   590  		b = append(b, '0')
   591  	}
   592  
   593  	b = strconv.AppendInt(b, int64(t.Second()), 10)
   594  	b = append(b, []byte{0x20, 0x28}...)
   595  
   596  	tz, _ := t.Zone()
   597  
   598  	if btz, ok := uz.timezones[tz]; ok {
   599  		b = append(b, btz...)
   600  	} else {
   601  		b = append(b, tz...)
   602  	}
   603  
   604  	b = append(b, []byte{0x29}...)
   605  
   606  	return string(b)
   607  }
   608  

View as plain text