Spurious comma after date range in "issued" field

edited January 18, 2022

I am trying to use a date range for certain citations, i.e. show the date as e.g. "1999-2002" instead of just "1999".

To do this, I am inputting "Issued: 1999/2002" in the "Extra" field in Zotero. But for some reason, this outputs to "1999-2002, . " with a spurious comma and space at the end, before the suffix I want (a period and a space)

This is not in my code, which specifies only the period and the space), and only happens if I input a date range. If I type "Issued: 1999", the output is "1999. ", as expected.

Has anyone encountered this before?
  • We'd have to see the style code or know which style you're using to say more. It's certainly not a general issue.
  • edited January 18, 2022
    Unfortunately, if I type code in here it doesn't appear in the posts. How could I show it to you?
  • We'd want to see the whole style, not just a specific line. Post to pastebin.com or a similar codesharing site.
    (you can place <code></code> around codes snippets here, but please don't use the forums for anything >10lines since that become unwieldy. )
  • Yeah, something isn't working right -- Zotero is duplicating the suffix when you have a date range.
    For an immediate fix, I'd just recommend getting rid of the suffix in favor of a group delimiter, along the lines of:
    <group delimiter=", " suffix=", ">
    <date date-parts="year-month" form="numeric" variable="issued"/>
    <number prefix="vol. " variable="volume"/>
    <number prefix="n° " variable="issue"/>

    It's generally preferable to work with delimiters as much as possible anyway.
  • edited January 19, 2022
    @emilianoeheyns Could you see if you can fix this? Seems to be applying the date suffix to both parts of a date range?

    @Euan_Wall An alternative for now might be to do a group with a delimiter instead of a suffix on the date.
  • edited January 19, 2022
    @adamsmith Thanks for your response! I'm not sure that duplication of the suffix was precisely what is happening, as the suffix I want in some item types is a period, not a comma. In my original code, book dates would output with the comma, and I still can't understand where it was getting the comma from at all.

    However, when I amended your kindly suggested code with periods when appropriate, and it worked! For a book, I now have:

    <group delimiter=". " suffix=". ">
    <date date-parts="year" form="text" variable="issued"/>
    <number suffix=" vol. " variable="number-of-volumes"/>
    <number suffix=" p. " variable="number-of-pages"/>

    And a date range is now outputted without the comma.


Sign In or Register to comment.