Dan Anglin
c53978cd91
- feat: add a field for the type of work location (e.g. hybrid) - refactor: move the Tex and PDF generating code to a new internal package which also moves the templates there as well. - fix: add a default value for the --output field for the generate command. - fix: add an error for when the user does not specify an input file when generating the PDF. - fix: the package name for each of the files in the templateFuncs package.
24 lines
422 B
Go
24 lines
422 B
Go
package templateFuncs
|
|
|
|
import (
|
|
"time"
|
|
|
|
"codeflow.dananglin.me.uk/apollo/spruce/internal/cv"
|
|
)
|
|
|
|
// 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
|
|
}
|
|
}
|