Dan Anglin
cee274318d
Create new FlagSets to create new subcommands. - The version subcommand prints the version and build info. - The generate subcommand generates the CV PDF documentation.
23 lines
417 B
Go
23 lines
417 B
Go
package templates
|
|
|
|
import (
|
|
"codeflow.dananglin.me.uk/apollo/spruce/internal/cv"
|
|
"time"
|
|
)
|
|
|
|
// WithinTimePeriod returns true if the employment's end date is within
|
|
// the specified time period.
|
|
func WithinTimePeriod(t time.Time) func(d cv.Duration) bool {
|
|
return func(d cv.Duration) bool {
|
|
if d.Present {
|
|
return true
|
|
}
|
|
|
|
result, err := d.After(t)
|
|
if err != nil {
|
|
return false
|
|
}
|
|
|
|
return result
|
|
}
|
|
}
|