Skip to content

Conversation

@Alex1034
Copy link

@Alex1034 Alex1034 commented Nov 11, 2025

Closes #8902

Summary

This pull request adds support for date ranges in BibLaTeX date fields.

Previously, JabRef only supported single dates (e.g., 2021-05-03).
With this change, JabRef now correctly parses and formats date ranges (e.g., 2020/2021, 2015-01-01/2016-12-31) in compliance with ISO 690 and BibLaTeX standards.

Steps to test

  1. Open the entry editor and locate the Date field.
  2. Try entering a date range, e.g.:
    • 2020/2021
    • 2021-05-01/2021-06-30
  3. Save and reopen the entry.
  4. Confirm that both start and end dates are parsed and displayed correctly.
  5. Export the entry to ensure the field is saved as date = {2020/2021}.

Additional details

  • Updated Date.java to normalize and handle start/end dates.
  • Updated DateEditorViewModel.java to correctly format and display date ranges.
  • Added normalization for incomplete date ranges (e.g., "2010/" → "2010").
  • Updated CHANGELOG.md under the [Unreleased] section.

Mandatory checks

  • I have followed the contributing guidelines
  • I have updated the CHANGELOG.md file
  • I have manually tested the change in JabRef
  • My code follows the project's code style and passes existing tests

@github-actions
Copy link
Contributor

Hey @Alex1034!

Thank you for contributing to JabRef! Your help is truly appreciated ❤️.

We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful.

Please re-check our contribution guide in case of any other doubts related to our contribution workflow.

@Override
public TemporalAccessor fromString(String string) {
if (StringUtil.isNotBlank(string)) {
// ✅ Sanitize incomplete ranges (e.g., "2010/" → "2010")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this AI comment

@calixtus calixtus changed the title [PATCH] Added support for date ranges for BibLaTeX Date Add support for date ranges for BibLaTeX Date Nov 15, 2025
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Tests are missing
  • CHANGELOG.md entry missing

@github-actions github-actions bot added the status: changes-required Pull requests that are not yet complete label Nov 20, 2025
@github-actions github-actions bot removed the status: changes-required Pull requests that are not yet complete label Nov 20, 2025
@jabref-machine
Copy link
Collaborator

Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Source Code Tests / Checkstyle (pull_request)" and click on it.

In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues, commit, and push.

@jabref-machine
Copy link
Collaborator

Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of [x] (done), [ ] (not done yet) or [/] (not applicable).

@jabref-machine
Copy link
Collaborator

You ticked that you modified CHANGELOG.md, but no new entry was found there.

If you made changes that are visible to the user, please add a brief description along with the issue number to the CHANGELOG.md file. If you did not, please replace the cross ([x]) by a slash ([/]) to indicate that no CHANGELOG.md entry is necessary. More details can be found in our Developer Documentation about the changelog.

@jabref-machine
Copy link
Collaborator

Your code currently does not meet JabRef's code guidelines. IntelliJ auto format covers some cases. There seem to be issues with your code style and autoformat configuration. Please reformat your code (Ctrl+Alt+L) and commit, then push.

In special cases, consider using // formatter:off and // formatter:on annotations to allow deviation from the code style.

@koppor koppor added the status: changes-required Pull requests that are not yet complete label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first contrib status: changes-required Pull requests that are not yet complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Save action "Normalize date" truncates an end of a range of dates

4 participants