You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
389 B
21 lines
389 B
package types
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"git.aiterp.net/rpdata/api/models"
|
|
)
|
|
|
|
type chapterResolver struct{}
|
|
|
|
func (r *chapterResolver) FictionalDate(ctx context.Context, chapter *models.Chapter) (*time.Time, error) {
|
|
if chapter.FictionalDate.IsZero() {
|
|
return nil, nil
|
|
}
|
|
|
|
return &chapter.FictionalDate, nil
|
|
}
|
|
|
|
// ChapterResolver is a resolver
|
|
var ChapterResolver chapterResolver
|