funcs

package
v0.0.0-...-3bb7120 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuncMap = map[string]interface{}{

	"add":  Add,
	"add1": Add1,
	"sub":  Sub,
	"sub1": Sub1,
	"subd": Subd,
	"ned":  Ned,
	"div":  Div,
	"mul":  Mul,
	"muld": Muld,
	"mod":  Mod,

	"eqd0": Eqd0,

	"iterate": IterateInt32,

	"jsonify":        Jsonify,
	"currencySymbol": CurrencySymbol,

	"humanizeNum": HumanizeNum,
	"pluralize":   Pluralize,

	"splitMap":                   SplitMap,
	"modifyImgURL":               ModifyImgURL,
	"genPageNums":                GenPageNums,
	"formatHandle":               FormatHandle,
	"injectCategoryIntoSiblings": InjectCategoryIntoSiblings,
	"isBrandChecked":             IsBrandChecked,
	"formatProductQty":           FormatProductQty,
	"getRootCategoryAlias":       GetRootCategoryAlias,
	"formatAddress":              FormatAddress,
	"stepperClass":               StepperClass,
	"addressesEmpty":             AddressesEmpty,
	"formatDate":                 FormatDate,
	"formatDateTime":             FormatDateTime,
	"formatTimeForJS":            FormatTimeForJS,
	"containsPath":               ContainsPath,
}

Functions

func Add

func Add(i ...interface{}) int64

func Add1

func Add1(i interface{}) int64

func AddressesEmpty

func AddressesEmpty(a, b anor.Address, c, d []anor.Address) bool

func ContainsPath

func ContainsPath(path, target string) bool

func CurrencySymbol

func CurrencySymbol(code string) string

func Div

func Div(a, b interface{}) int64

func Eqd0

func Eqd0(a decimal.Decimal) bool

func FormatAddress

func FormatAddress(address anor.Address) template.HTML

func FormatDate

func FormatDate(t time.Time) string

FormatDate formats a time.Time value for date-only display

func FormatDateTime

func FormatDateTime(t time.Time) string

FormatDateTime formats a time.Time value for general date and time display

func FormatHandle

func FormatHandle(handle string, id interface{}) string

func FormatProductQty

func FormatProductQty(count int) string

func FormatTimeForJS

func FormatTimeForJS(t time.Time) string

FormatTimeForJS formats a time.Time value for JavaScript parsing

func GenPageNums

func GenPageNums(currentPage, pageCount, maxPages int) []int

func GetRootCategoryAlias

func GetRootCategoryAlias(category string) string

func HumanizeNum

func HumanizeNum(num interface{}) string

func InjectCategoryIntoSiblings

func InjectCategoryIntoSiblings(c anor.Category, siblings []anor.Category) []anor.Category

func IsBrandChecked

func IsBrandChecked(brand string, brands []string) bool

func IterateInt32

func IterateInt32(max int32) []int32

func Jsonify

func Jsonify(data interface{}) template.JS

func Mod

func Mod(a, b interface{}) int64

func ModifyImgURL

func ModifyImgURL(url string, resolution int) string

func Mul

func Mul(a, b interface{}) int64

func Muld

func Muld(a decimal.Decimal, b int32) decimal.Decimal

func Ned

func Ned(a, b decimal.Decimal) bool

func Pluralize

func Pluralize(n int, word string) string

func SplitMap

func SplitMap(m map[string]string) struct {
	First  map[string]string
	Second map[string]string
}

func StepperClass

func StepperClass(i, curr int) string

func Sub

func Sub(a, b interface{}) int64

func Sub1

func Sub1(i interface{}) int64

func Subd

func Subd(a, b decimal.Decimal) decimal.Decimal

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL