utils

package
v0.0.0-...-107286f Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateSyntaxError        = "invalid date syntax. date must be in a valid format or one of the predefined builtins like today, yesterday"
	DateRangeSyntaxError   = "invalid date range synxtax. Must be one of the following: :date, date:, date:date"
	AmountSyntaxError      = "invalid amount syntax. amount must be in a valid format"
	AmountRangeSyntaxError = "invalid amount range syntax. must be one of the following: :amount, amount:, amount:amount"
)

Variables

View Source
var ValidDateBuiltins = []string{
	"today",
	"yesterday",
	"thisweek",
	"lastweek",
	"thismonth",
	"lastmonth",
	"thisyear",
	"lastyear",
}

Functions

func APPDIR

func APPDIR() string

func CheckAmount

func CheckAmount(amounts ...*string) error

func CheckAmountRange

func CheckAmountRange(amount *string) error

func Checkdate

func Checkdate(dates ...*string) error

func CheckdateRange

func CheckdateRange(date *string) error

func ClearScreen

func ClearScreen()

func ConvertToDateFormat

func ConvertToDateFormat(date string) string

func DBPATH

func DBPATH() string

func ExecShellCmd

func ExecShellCmd(command string, args ...string) string

func HRTime

func HRTime(date string) string

conver time to human readable time

func IsInitialized

func IsInitialized() bool

func IsValidAmountFormat

func IsValidAmountFormat(amount string) bool

func IsValidDateFormat

func IsValidDateFormat(date string) bool

func IsValueRange

func IsValueRange(value string) bool

func PadDate

func PadDate(date string) string

func PrintError

func PrintError(err error, message string, debug bool)

func PromptConfirmation

func PromptConfirmation() bool

func SplitAmountRange

func SplitAmountRange(amountRange string) []string

func SplitDateRange

func SplitDateRange(dateRange string) []string

func ToInt

func ToInt(s string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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