Documentation ¶
Index ¶
- func FormatCSVMessage(ctx *context.Configuration, punches []*model.PunchResponse) ([]byte, error)
- func GetDefaultMessage(ctx *context.Configuration, message string, datetime time.Time) string
- func GetPassword() ([]byte, error)
- func IsHoliday(date time.Time) bool
- func IsRegularDay(date time.Time) bool
- func IsSameDay(day1, day2 time.Time) bool
- func IsSaturday(date time.Time) bool
- func IsSunday(date time.Time) bool
- func IsWeekHoliday(date time.Time) bool
- func IsWeekday(date time.Time) bool
- func ParseFlagDate(date string) (time.Time, error)
- func ParseFlagDatetime(date, hour string) (time.Time, error)
- func PrintUsage()
- func RangeBetweenDatesInDays(start, end string) (time.Time, time.Time, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatCSVMessage ¶ added in v0.0.3
func FormatCSVMessage(ctx *context.Configuration, punches []*model.PunchResponse) ([]byte, error)
FormatCSVMessage returns a slice of bytes and an error based on a valid context and a pointer to a punch query response entity. It converts the punches query into a valid format that will be converted into a report used for automatic validation.
func GetDefaultMessage ¶
GetDefaultMessage returns a valid string message. If message provided is empty it will check the datetime and return an adequate WorkStart or WorkEnd message.
func IsRegularDay ¶
IsRegularDay reports whether date is NOT a holiday as provided by the config file and is also a weekday neither saturday nor sunday.
func IsSameDay ¶
IsSameDay reports whether day1 and day2 have same day, month and year. It does not check for hours, minutes and seconds.
func IsSaturday ¶
IsSaturday reports whether date is a saturday
func IsWeekHoliday ¶
IsWeekHoliday reports whether date is a holiday as provided by the config file and is also a weekday neither saturday nor sunday.
func ParseFlagDate ¶
ParseFlagDate returns a Time and an error. It will attempt to parse the date given that it is in a valid format ('d-m-yy') and return it as a time.Time format.
func ParseFlagDatetime ¶
ParseFlagDatetime returns a Time and an error. It will attempt to parse the date and hour given that they are both in valid formats (date: 'd-m-yy', hour: 'HH:mm') and return it as a time.Time format.
func PrintUsage ¶
func PrintUsage()
PrintUsage is responsible for printing a valid doc message based upon the command provided. When invalid command default message will be provided.
func RangeBetweenDatesInDays ¶
RangeBetweenDatesInDays returns start and end as time.Time formats an int representing the range size in days and an error. It will attempt to parse start and end date given that they are in a valid format ('d-m-yy') to time.Time format and calculate the range in days between them.
Types ¶
This section is empty.