aboutsummaryrefslogtreecommitdiffstats
path: root/skate/reduce.go
diff options
context:
space:
mode:
Diffstat (limited to 'skate/reduce.go')
-rw-r--r--skate/reduce.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/skate/reduce.go b/skate/reduce.go
index 356ed25..4cd604a 100644
--- a/skate/reduce.go
+++ b/skate/reduce.go
@@ -574,7 +574,7 @@ func matchedRefsExtend(matched []*BiblioRef, refs []*Ref, stats *statsAugment) [
var (
authors []CSLAuthor
isbn string
- year string
+ issued *CSLDate
)
for _, name := range r.Biblio.ContribRawNames {
authors = append(authors, CSLAuthor{Name: name})
@@ -582,8 +582,11 @@ func matchedRefsExtend(matched []*BiblioRef, refs []*Ref, stats *statsAugment) [
if len(r.Biblio.Extra.ISBN) > 0 {
isbn = r.Biblio.Extra.ISBN[0]
}
- if r.Biblio.Year > 1500 && r.Biblio.Year < 2022 {
- year = fmt.Sprintf("%d", r.Biblio.Year)
+ // TODO: need to update this "max year" number frequently?
+ if r.Biblio.Year > 1500 && r.Biblio.Year <= 2025 {
+ issued = &CSLDate{Parts: [][]int{{int(r.Biblio.Year)}}}
+ } else {
+ issued = &CSLDate{}
}
bref.TargetCSL = &CSL{
Author: authors,
@@ -598,9 +601,7 @@ func matchedRefsExtend(matched []*BiblioRef, refs []*Ref, stats *statsAugment) [
Title: r.Biblio.Title,
URL: r.Biblio.Url,
Volume: r.Biblio.Volume,
- Issued: &CSLDate{
- Raw: year,
- },
+ Issued: issued,
}
}
// Reuse fields for debugging, for now.