Skip to content

Commit

Permalink
MS Office XML: Export month name (#7677)
Browse files Browse the repository at this point in the history
* MS Office XML: Export month name


Fixe https://discourse.jabref.org/t/export-month-as-text-not-number/2685

* Update CHANGELOG.md

fix checkstyle in changelog

* remove unceessary toStrng call, add test for biblatex as well
  • Loading branch information
Siedlerchr authored Apr 30, 2021
1 parent 7f31329 commit f504ff0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We improved the linking of the `python3` interpreter via the shebang to dynamically use the systems default Python. Related to [JabRef-Browser-Extension #177](https://github.com/JabRef/JabRef-Browser-Extension/issues/177)
- Automatically found pdf files now have the linking button to the far left and uses a link icon with a plus instead of a briefcase. The file name also has lowered opacity(70%) until added. [#3607](https://github.com/JabRef/jabref/issues/3607)
- We simplified the select entry type form by splitting it into two parts ("Recommended" and "Others") based on internal usage data. [#6730](https://github.com/JabRef/jabref/issues/6730)
- The export to MS Office XML now uses the month name for the field `Month` instead of the two digit number [forum#2685](https://discourse.jabref.org/t/export-month-as-text-not-number/2685)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/msbib/MSBibConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static MSBibEntry convert(BibEntry entry) {
}

result.day = entry.getFieldOrAliasLatexFree(StandardField.DAY).orElse(null);
result.month = entry.getMonth().map(Month::getNumber).map(Object::toString).orElse(null);
result.month = entry.getMonth().map(Month::getFullName).orElse(null);

if (!entry.getLatexFreeField(StandardField.YEAR).isPresent()) {
result.year = entry.getFieldOrAliasLatexFree(StandardField.YEAR).orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</b:Author>
</b:Author>
<b:Year>2002</b:Year>
<b:Month>7</b:Month>
<b:Month>July</b:Month>
<b:Day>3</b:Day>
<b:ThesisType>Tech. rep.</b:ThesisType>
</b:Source>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
% Encoding: UTF-8
@TechReport{,
author = {Sam and jason},
date = {2002-07-03},
}

@Comment{jabref-meta: databaseType:biblatex;}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<b:Sources xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" SelectedStyle="">
<b:Source>
<b:BIBTEX_Entry>techreport</b:BIBTEX_Entry>
<b:SourceType>Report</b:SourceType>
<b:Author>
<b:Author>
<b:NameList>
<b:Person>
<b:Last>Sam</b:Last>
</b:Person>
<b:Person>
<b:Last>jason</b:Last>
</b:Person>
</b:NameList>
</b:Author>
</b:Author>
<b:Year>2002</b:Year>
<b:Month>July</b:Month>
<b:Day>3</b:Day>
<b:ThesisType>Tech. rep.</b:ThesisType>
</b:Source>
</b:Sources>

0 comments on commit f504ff0

Please sign in to comment.