From f504ff0ccf6edfd1bec7f0c1f685fc18b5a8190f Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 30 Apr 2021 23:20:43 +0200 Subject: [PATCH] MS Office XML: Export month name (#7677) * 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 --- CHANGELOG.md | 1 + .../jabref/logic/msbib/MSBibConverter.java | 2 +- .../exporter/MsBibExportFormatTestDay.xml | 2 +- .../MsBibExportFormatTestDayBiblatex.bib | 8 +++++++ .../MsBibExportFormatTestDayBiblatex.xml | 23 +++++++++++++++++++ 5 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDayBiblatex.bib create mode 100644 src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDayBiblatex.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index b1936d6b827..8b832e4b2da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java index 2ee5d0c9e50..5b282296c0e 100644 --- a/src/main/java/org/jabref/logic/msbib/MSBibConverter.java +++ b/src/main/java/org/jabref/logic/msbib/MSBibConverter.java @@ -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); diff --git a/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDay.xml b/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDay.xml index a6e655b3cb4..9b477d9224f 100644 --- a/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDay.xml +++ b/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDay.xml @@ -16,7 +16,7 @@ 2002 - 7 + July 3 Tech. rep. diff --git a/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDayBiblatex.bib b/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDayBiblatex.bib new file mode 100644 index 00000000000..047b696df13 --- /dev/null +++ b/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDayBiblatex.bib @@ -0,0 +1,8 @@ +% Encoding: UTF-8 + +@TechReport{, + author = {Sam and jason}, + date = {2002-07-03}, +} + +@Comment{jabref-meta: databaseType:biblatex;} diff --git a/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDayBiblatex.xml b/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDayBiblatex.xml new file mode 100644 index 00000000000..9b477d9224f --- /dev/null +++ b/src/test/resources/org/jabref/logic/exporter/MsBibExportFormatTestDayBiblatex.xml @@ -0,0 +1,23 @@ + + + + techreport + Report + + + + + Sam + + + jason + + + + + 2002 + July + 3 + Tech. rep. + +