Skip to content

Instantly share code, notes, and snippets.

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)
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)
}