lib/bibtex/entry/citeproc_converter.rb in bibtex-ruby-5.1.3 vs lib/bibtex/entry/citeproc_converter.rb in bibtex-ruby-5.1.4

- old
+ new

@@ -18,10 +18,11 @@ school publisher institution publisher organization publisher howpublished publisher type genre + urldate accessed ].map(&:intern)]).freeze CSL_FIELDS = %w[ abstract annote archive archive_location archive-place authority call-number chapter-number citation-label citation-number @@ -119,9 +120,24 @@ else hash['issued'] = { 'literal' => bibtex[:year].to_s } end end + end + + def accessed + return unless hash.key? 'accessed' + + hash['accessed'] = + case hash['accessed'] + when %r{^[\d/\s-]+$} + { + 'date-parts' => + hash['accessed'].split('/').map { |pt| pt.split('-').map(&:to_i) } + } + else + { 'literal' => hash['accessed'] } + end end def key hash['id'] = bibtex.key.to_s end