github.com/spi-ca/misc@v1.0.1/dttm/between.go (about)

     1  package dttm
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  //BetweenTwoDates is a function that checks if a given date is between a start date and an end date.
     8  func BetweenTwoDates(target, start, end time.Time) bool {
     9  	return (start.Before(target) || start.Equal(target)) && end.After(target)
    10  }