Coder Social home page Coder Social logo

Comments (6)

kadnan avatar kadnan commented on August 26, 2024

@vruusmann is this issue related to your Library?

from citeproc-java.

vruusmann avatar vruusmann commented on August 26, 2024

No, it's not related to jbibtex/jbibtex. All the temporal fields of a BibTeX entry (e.g. "year", "month") are returned as strings (or nulls if they are missing). Proper mapping and data type conversion is the responsibility of the citeproc-java library.

from citeproc-java.

michel-kraemer avatar michel-kraemer commented on August 26, 2024

Just like in issue #5, I need the corresponding BibTeX entry in order to reproduce this issue. Can you please send it to me? Thanks.

Michel

from citeproc-java.

michel-kraemer avatar michel-kraemer commented on August 26, 2024

The test files you sent me in issue #5 do not contain months. Please give me more details so I can reproduce the issue.

Michel

from citeproc-java.

kadnan avatar kadnan commented on August 26, 2024

will it work only for the field year but not for the field timestamp?
what to use for timestamp?

On Sat, Feb 8, 2014 at 12:41 AM, Michel Krämer [email protected]:

The test files you sent me in issue #5https://github.com/michel-kraemer/citeproc-java/issues/5do not contain months. Please give me more details so I can reproduce the
issue.

Michel

Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-34493348
.

from citeproc-java.

michel-kraemer avatar michel-kraemer commented on August 26, 2024

timestamp is an attribute added by JabRef. It tells you when you inserted the entry to your database, but it has nothing to do with the actual publication date. Hence there is no mapping from this attribute to any CSL variable (http://citationstyles.org/downloads/specification.html#appendix-iv-variables).

If you want to output the timestamps you have to access the original BibTeX and then use CSLDateParser.

Key timestampKey = new Key("timestamp");
CSLDateParser dateParser = new CSLDateParser();
for (BibTeXEntry e : db.getEntries().values()) {
    Value ts = e.getField(timestampKey);
    CSLDate date = dateParser.parse(ts.toUserString());
    System.out.println("Year: " + date.getDateParts()[0][0]);
    if (date.getDateParts()[0].length > 1)
        System.out.println("Month: " + date.getDateParts()[0][1]);
    if (date.getDateParts()[0].length > 2)
        System.out.println("Day: " + date.getDateParts()[0][2]);
}

Cheers,
Michel

from citeproc-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.