utils

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BTreeDescendFirstLessOrEqual

func BTreeDescendFirstLessOrEqual[I btree.Item](tree *btree.BTree, item I) I

func BTreeToSlice added in v0.3.5

func BTreeToSlice[I btree.Item](tree *btree.BTree) []I

func BeginningOfFinancialYear added in v0.1.3

func BeginningOfFinancialYear(date time.Time) time.Time

func BeginningOfMonth added in v0.1.3

func BeginningOfMonth(date time.Time) time.Time

func Dos2Unix added in v0.5.4

func Dos2Unix(str string) string

func EndOfDay added in v0.5.2

func EndOfDay(date time.Time) time.Time

func EndOfFinancialYear added in v0.1.3

func EndOfFinancialYear(date time.Time) time.Time

func EndOfMonth added in v0.1.3

func EndOfMonth(date time.Time) time.Time

func EndOfToday added in v0.5.2

func EndOfToday() time.Time

func Exec added in v0.5.0

func Exec(name string, stdout *bytes.Buffer, stderr *bytes.Buffer, args ...string) error

func FY added in v0.2.2

func FY(date time.Time) string

func FYHuman added in v0.3.1

func FYHuman(date time.Time) string

func FileExists added in v0.5.0

func FileExists(path string) bool

func FirstName added in v0.5.9

func FirstName(account string) string

func GroupByDate added in v0.5.9

func GroupByDate[G GroupableByDate](groupables []G) map[string][]G

func GroupByFY added in v0.4.5

func GroupByFY[G GroupableByDate](groupables []G) map[string][]G

func GroupByMonth added in v0.4.5

func GroupByMonth[G GroupableByDate](groupables []G) map[string][]G

func GroupByYearCutoffAt added in v0.6.5

func GroupByYearCutoffAt[G GroupableByDate](groupables []G, date time.Time) map[string][]G

func IsCheckingAccount added in v0.4.8

func IsCheckingAccount(account string) bool

func IsCurrency added in v0.3.7

func IsCurrency(currency string) bool

func IsExpenseInterestAccount added in v0.5.2

func IsExpenseInterestAccount(account string) bool

func IsNowDefined added in v0.5.6

func IsNowDefined() bool

func IsParent added in v0.5.6

func IsParent(account string, comparison string) bool

func IsSameDate added in v0.5.6

func IsSameDate(a time.Time, b time.Time) bool

func IsSameOrParent added in v0.2.4

func IsSameOrParent(account string, comparison string) bool

func IsWithDate added in v0.1.5

func IsWithDate(date time.Time, start time.Time, end time.Time) bool

func MaxTime added in v0.4.2

func MaxTime(a time.Time, b time.Time) time.Time

func Now added in v0.5.2

func Now() time.Time

func OpenDB added in v0.5.1

func OpenDB() (*gorm.DB, error)

func ParseFY added in v0.5.9

func ParseFY(fy string) (time.Time, time.Time)

func ReplaceLast added in v0.6.0

func ReplaceLast(haystack, needle, replacement string) string

func SetNow added in v0.5.2

func SetNow(date string)

func Sha256 added in v0.6.1

func Sha256(str string) string

func SortedKeys added in v0.4.8

func SortedKeys[K constraints.Ordered, V any](m map[K]V) []K

func SumBy added in v0.4.8

func SumBy[C any](collection []C, iteratee func(item C) decimal.Decimal) decimal.Decimal

func UnQuote added in v0.5.0

func UnQuote(str string) string

func YearHumanCutOffAt added in v0.6.5

func YearHumanCutOffAt(date time.Time, cutoff time.Time) string

Types

type GroupableByDate added in v0.4.5

type GroupableByDate interface {
	GroupDate() time.Time
}

Jump to

Keyboard shortcuts

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