typst / biblatex

A Rust crate for parsing and writing BibTeX and BibLaTeX files.
Apache License 2.0
120 stars 15 forks source link

Support for access time in bibliography #54

Open robertosw opened 2 months ago

robertosw commented 2 months ago

Description

I want to show what time I accessed a resource.

As hayagriva does not support the use of a time, I have switched to the BibTeX format. Using this entry compiles without errors:

@online{online-source,
    author    = "Donald Knuth",
    title     = "Knuth: Computers and Typesetting",
    url       = "http://www-cs-faculty.stanford.edu/~uno/abcde.html",
    urldate   = {2024-05-09T14:30:00},
}

But the bibliography only renders the date: Bildschirmfoto vom 2024-05-09 17-58-20

I have used the IEEE style and tried several others and none of them rendered the time, so I suspect it is not a matter of the style used.

I have already added an issue in the hayagriva repo to add support for the access time: https://github.com/typst/hayagriva/issues/160

Use Case

To be able to use a more detailed access timestamp for online ressources

quachpas commented 1 month ago

This should probably be transferred to https://github.com/typst/biblatex

If I understand well:

  1. The field urldate is parsed for year, month and day; no information about the time is parsed
  2. Parsing a Datetime is already implemented in date.rs
  3. In biblatex, options dateusetime and seconds must be set to true in order to print the full timestamp.

[1] https://github.com/typst/biblatex/blob/main/src/macros.rs#L58 [2] https://github.com/typst/biblatex/blob/a43de9ca4fb5c981c39c4c162e6df54684015fc8/src/types/date.rs#L37