utils

package
v0.0.0-...-d9eb902 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NumberOfMonthsInAYear = 12
)

Variables

This section is empty.

Functions

func AlmostEqual

func AlmostEqual(a, b float64) bool

func CopyTime

func CopyTime(d time.Time) time.Time

func GetFirstDateOfMonth

func GetFirstDateOfMonth(d time.Time) time.Time

func GetLastDateOfMonth

func GetLastDateOfMonth(d time.Time) time.Time

func GetLocalRepoLocation

func GetLocalRepoLocation() string

func SetDateFromString

func SetDateFromString(date string) (time.Time, error)

Accepts yyyy-mm-dd

func SetDateTo0000Hours

func SetDateTo0000Hours(d time.Time) time.Time

SG time

func SetDateToEndOfMonth

func SetDateToEndOfMonth(d time.Time) time.Time

func SetDateToEndOfMonthFinancials

func SetDateToEndOfMonthFinancials(d time.Time) time.Time

func UnmarshalCSV

func UnmarshalCSV(filepath string, obj interface{}) error

func UnmarshalYAML

func UnmarshalYAML(path string, obj interface{}) error

Types

type DateTime

type DateTime struct {
	time.Time
}

func (*DateTime) GetTime

func (dt *DateTime) GetTime() time.Time

func (DateTime) GormDBDataType

func (DateTime) GormDBDataType(db *gorm.DB, field *schema.Field) string

func (DateTime) GormDataType

func (DateTime) GormDataType() string

func (*DateTime) Scan

func (dt *DateTime) Scan(value interface{}) error

func (*DateTime) UnmarshalCSV

func (date *DateTime) UnmarshalCSV(csv string) (err error)

Convert the CSV string as internal date

func (DateTime) Value

func (dt DateTime) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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