Skip to content

Instantly share code, notes, and snippets.

package main
import (
"context"
"time"
"github.com/pipedrive/fastis-packages/asyncutil"
"github.com/pkg/errors"
)
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)