-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add BibLatex date formats for parsing to Date.java #9720
Add BibLatex date formats for parsing to Date.java #9720
Conversation
Adds date formats set by BibLatex to the Date.java class. Formats are included in the list that was already present in the class. Tested locally.
Thanks for your contribution. Please link to the issue with e.g Fixes #.... and also please add tests and a changelog entry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a changelog entry and most importantly add tests. Thanks!
"y-M/y-M", // covers 2015-01/2015-02 | ||
"MMMM y/MMMM y", // covers January 2015/February 2015 | ||
"d MMMM y/d MMMM y", // covers 20 January 2015/20 February 2015 | ||
"y G", // covers 1 BC | ||
"y G / y G", // covers 30 BC / 5 AD | ||
"yyyy G / yyyy G", // covers 0030 BC / 0005 AD | ||
"yyyy-MM G / yyyy-MM G", // covers 0030-01 BC / 0005-02 AD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These date ranges are not yet parsed correctly. The static parse method must probably be adapted somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, see https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/time/format/DateTimeFormatter.html
and
jabref/src/main/java/org/jabref/model/entry/Date.java
Lines 102 to 103 in 170033a
// if dateString has format of uuuu/uuuu, treat as date range | |
if (dateString.matches("[0-9]{4}/[0-9]{4}")) { |
There are already existing unit tests which you need to extend.
PR was updated |
@GuyPuts After pushing, you should check the output of the tests going on at GitHub. I put you a screenshot: It says, checkstyle failed. You can go to the files tab to see the errors https://github.com/JabRef/jabref/pull/9720/files Alternateively, you can execute checkstyle in your ide as described at https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace/intellij-13-code-style.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think besides the small comments, this is good to go?
…biblatex-date-formats * upstream/main: (132 commits) Add four rules not having any effect Apply BooleanChecksNotInverted Remove unused RadioButtonCell Minimal config for openRewrite Fix missing # Fix modernizer (JabRef#9824) CHANGELOG.md Removed unused code Refined ui Dissolved FileTab and moved contents to EntryTab Renamed CustomEditorFieldsTab to EntryEditorTabsTab Fixed antipattern, fixed radiobutton with checkbox Renamed ImportExportPreferences to ExportPreferences Improve search history by attaching change listener (JabRef#9794) Separated WebSearchPrefs and ExportPrefs Separated WebSearchTab and ExportTab Renamed ImportExportTab to WebSearchTab Fix split multiline localization (JabRef#9814) New Crowdin updates (JabRef#9834) change versin to 0.8.10 ...
make parameterized test
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the tests fail, something should be done to get them running.
rather add a todo
Follow up task (n oted in the issue) |
contributes to #2753
Adds date formats set by BibLatex to the Date.java class. Formats are included in the list that was already present in the class. Tested locally.
Compulsory checks