-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Improve date parsing #2731
Improve date parsing #2731
Conversation
* - "uuuu.M.d" (covers 2015.1.15) | ||
* The code is essentially taken from http://stackoverflow.com/questions/4024544/how-to-parse-dates-in-multiple-formats-using-simpledateformat. | ||
*/ | ||
public static Optional<Date> parse(String dateString) { |
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.
Theoretically we should support all allowed date formats from biblatex: EDTF format
2.3.8 Date and Time Specifications
A while ago I looked into that and found that there is no easy way to support all in java.
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 have moved this into issue #2753
*/ | ||
public enum Month { | ||
|
||
JANUARY("January", "jan", "01", "#jan#", 0), |
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.
With the JAVA 8 Date Time changes, month now are 1-12 and no longer 0-11
In general LGTM |
@@ -5,7 +5,7 @@ @Article{Orlowski;2011 | |||
title = {Application of Ontology In the ITIL Domain}, | |||
journal = {Information Systems Architecture and Technology: Service Oriented Networked Systems}, | |||
year = {2011}, | |||
month = {mar}, | |||
month = {03}, |
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.
Isn't month = mar
the correct format for BibTex?!
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.
It's only, because many styles define the string mar
. At least this is what I read from the discussion at https://tex.stackexchange.com/q/70455/9075.
This PR improves a few small things about the date parsing:
NormalizeDateFormatter
,BibEntry
and in some importer. All these code snippets are now merged in a newDate
class. This resulted in more robust code and slightly improved parsing performance.MonthUtil
class is now an enum with a few static helper methods.gradle localizationUpdate
?