Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSL-JSON dates are wrong #53

Closed
larsgw opened this issue Jul 27, 2017 · 11 comments
Closed

CSL-JSON dates are wrong #53

larsgw opened this issue Jul 27, 2017 · 11 comments
Assignees
Labels
bug Something isn't working right

Comments

@larsgw
Copy link
Owner

larsgw commented Jul 27, 2017

Problem

The CSL-JSON date format used in Citation.js is wrong, and therefore not picked up by citeproc-js.

Consequence

All dates are omitted in all formatted Citation.js output.

Cause

Miscommunication. When designing this version of Citation.js, a different date format was taken into account, as that was the documented format back then.

Expected solution

Solution isn't trivial, but not really complex either. Just a lot of time making sure everything is updated. Problem expected to be fixed in v0.3.0-11.


Thanks to @austinjp for uncovering this issue in #52 and to @fbennett for helping with the citeproc-js side of things.

@larsgw larsgw added the bug Something isn't working right label Jul 27, 2017
@larsgw larsgw self-assigned this Jul 27, 2017
@lexnat187
Copy link

lexnat187 commented Jul 28, 2017

@larsgw do you have a projected completion date for v.0.3.0-11?
I also noticed that the dates are not being past to the CSL processor and therefor missing from outputs, though it is working correctly for Bibtex outputs.
Is this something that I could pick up and help out with? If you could point me in the direction of the area responsible for it I can have a look at it this weekend.

@larsgw
Copy link
Owner Author

larsgw commented Jul 28, 2017

@lexnat187 Hopefully later today. Surprisingly, the most basic fix already works, but only at output level, so not for Cite.parse.*() or the Cite#data property yet. Doing that will take a lot longer, because there's a lot more methods that need to change. Test cases also need to be updated. However, that shouldn't take too long, I hope.

@lexnat187
Copy link

@larsgw that's great news. Let me know when your done and I can test it with my implementation. Let me know if I can help.

@larsgw
Copy link
Owner Author

larsgw commented Jul 28, 2017

Delay and dismay: trouble because of browser distributions. Very annoying. I hope to be able to release it anyway, somewhere before 01:00 UTC.

@larsgw
Copy link
Owner Author

larsgw commented Jul 28, 2017

v0.3.0-11 is live.

Note:

  1. Browser tests don't work yet
  2. Browser demo will be updated shortly
  3. Loose years in BibTeX input don't work yet; use the date field

@larsgw larsgw closed this as completed Jul 28, 2017
@larsgw
Copy link
Owner Author

larsgw commented Jul 28, 2017

I missed one reference to the old format... I'm really tied up in testing frameworks etc. (#55, #49) right now so fix might take some longer. Just don't sort by accessed or issued for now.

@larsgw
Copy link
Owner Author

larsgw commented Aug 24, 2017

Completely fixed now, loose years (and months) as well.

@rmzelle
Copy link

rmzelle commented Jul 14, 2018

@larsgw, one of my users reported an issue with BibTeX output missing date information (with citation.js v0.4.0-7). My input is CSL JSON. With CSL JSON as output format, the output is:

[
  {
    "id": 454,
    "type": "article-journal",
    "title": "Abortion in the lives of women struggling financially: why insurance coverage matters",
    "container-title": "Guttmacher Policy Review",
    "page": "46–52",
    "volume": "19",
    "source": "Google Scholar",
    "shortTitle": "Abortion in the lives of women struggling financially",
    "author": [
      {
        "family": "Boonstra",
        "given": "Heather D."
      }
    ],
    "issued": {
      "date-parts": [
        [
          2016
        ]
      ]
    }
  }
]

With BibTeX as output format, the output is:

@article{Boonstra2016Abortion,
	journal={Guttmacher Policy Review},
	title={{Abortion in the lives of women struggling financially: why insurance coverage matters}},
	volume=19,
	author={Boonstra, Heather D.},
	pages={46–52},
}

As you can see, the "issued" date is missing from the BibTeX output. I do see dates in the BibTeX output for full dates (with year, month, and day), e.g.:

CSL JSON as output:

  {
    "id": 459,
    "type": "report",
    "title": "State Funding of Abortion Under Medicaid",
    "publisher": "Guttmacher Institute",
    "URL": "https://www.guttmacher.org",
    "issued": {
      "date-parts": [
        [
          2018,
          2,
          1
        ]
      ]
    }
  }
]

BibTeX as output:

@techreport{2018State,
	publisher={Guttmacher Institute},
	title={{State Funding of Abortion Under Medicaid}},
	url={https://www.guttmacher.org},
	date={2018-02-01},
	year=2018,
	month=2,
	day=1,
}

@larsgw
Copy link
Owner Author

larsgw commented Jul 14, 2018

Previously, empty parts in the date were filled in with 1, the default of the native date parser. This apparently breaks breaks some checks, and wasn't caught by test cases. I'm including a fix in the next release.

larsgw added a commit that referenced this issue Jul 14, 2018
Fix handling of incomplete dates (i.e. date-parts
with only a year or a year and a month) by output
formatters like BibTeX and RIS.

See #127, #138, #139
See #53 (comment)
@larsgw
Copy link
Owner Author

larsgw commented Jul 14, 2018

Fixed in v0.4.0-8. Now the output is:

@article{Boonstra2016Abortion,
	journal={Guttmacher Policy Review},
	title={{Abortion in the lives of women struggling financially: why insurance coverage matters}},
	volume=19,
	author={Boonstra, Heather D.},
	pages={46–52},
	date=2016,
	year=2016,
}

@rmzelle
Copy link

rmzelle commented Jul 15, 2018

Thanks for the very quick fix!

larsgw added a commit to citation-js/date that referenced this issue Jul 24, 2018
Fix handling of incomplete dates (i.e. date-parts
with only a year or a year and a month) by output
formatters like BibTeX and RIS.

See #127, #138, #139
See larsgw/citation.js#53 (comment)
larsgw added a commit to citation-js/citation-js that referenced this issue Nov 24, 2018
Fix handling of incomplete dates (i.e. date-parts
with only a year or a year and a month) by output
formatters like BibTeX and RIS.

See #127, #138, #139
See larsgw/citation.js#53 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

No branches or pull requests

3 participants