This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func CalculateEvectivityTimespan(dueDate, dueTime, duration string) (*protocol.EvectivityDateTime, *protocol.EvectivityDateTime, error) { | |
if dueTime == "" { | |
return dateOnlySpan(dueDate, duration) | |
} | |
return dateTimeSpan(dueDate, dueTime, duration) | |
} | |
func dateOnlySpan(dueDate, duration string) (*protocol.EvectivityDateTime, *protocol.EvectivityDateTime, error) { | |
start, err := time.Parse(PDDateFormat, dueDate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func sanitize(args ...interface{}) []interface{} { | |
res := make([]interface{}, 0, len(args)) | |
for _, v := range args { | |
switch a := v.(type) { | |
case protoreflect.ProtoMessage: | |
res = append(res, sanitizeProtoMessage(a)) | |
default: | |
res = append(res, a) | |
} |
OlderNewer