Documentation
¶
Index ¶
- Constants
- Variables
- func CheckMonthInRange(inputMonth string) bool
- func CompareMonthToCurrent(yearMonth string) (int, error)
- func FilterDates(dates []string, comparisonType DateComparisonType) ([]string, error)
- func GetAllDaysInMonth(yearMonth string) ([]string, error)
- func GetCurrentYearMonthDay() string
- func GetRecentDayList() []string
- func GetTimeDifference(previousTime, currentTime string) string
- func InterfaceToString(in interface{}) string
- func IsTodayFromString(dateStr string) (bool, error)
- func NewExcel(filename string) (*excelize.File, error)
- func ParseDuration(durationStr string) (time.Duration, error)
- func ParseInt64ByStr(strIds []string) ([]int64, error)
- func ParseLogLevel(s string) log.Lvl
- func ParserConfigurationByFile(format, in string, out interface{}) error
- func TimeNowFormat() string
- func TimeParse(times string) (time.Duration, error)
- type DateComparisonType
Constants ¶
View Source
const ( YAML = "yaml" JSON = "json" BeforeToday DateComparisonType = iota AfterToday ParseFixedTimeFormat = "2006-01-02 15:04:05.000" YearMonthFormat = "2006-01" YearMonthDayFormat = "2006-01-02" YearMonthDayHourMinuteSecond = "2006-01-02 15:04:05" )
Variables ¶
View Source
var (
DefaultTimeLoc, _ = time.LoadLocation("Asia/Shanghai")
)
Functions ¶
func CheckMonthInRange ¶
func CompareMonthToCurrent ¶
CompareMonthToCurrent return -1(lt),0(eq),1(gt)
func FilterDates ¶
func FilterDates(dates []string, comparisonType DateComparisonType) ([]string, error)
FilterDates 根据比较类型过滤出符合条件的日期
func GetAllDaysInMonth ¶
func GetCurrentYearMonthDay ¶
func GetCurrentYearMonthDay() string
func GetRecentDayList ¶
func GetRecentDayList() []string
func GetTimeDifference ¶
func InterfaceToString ¶
func InterfaceToString(in interface{}) string
func IsTodayFromString ¶
func ParseInt64ByStr ¶
func ParseLogLevel ¶
func TimeNowFormat ¶
func TimeNowFormat() string
Types ¶
type DateComparisonType ¶
type DateComparisonType int
Click to show internal directories.
Click to hide internal directories.