Skip to content

Commit 4c11664

Browse files
use localdatetime instead of zonedDateTime
1 parent 958c50f commit 4c11664

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/net/sf/jabref/gui/date/DatePickerButton.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.awt.BorderLayout;
44
import java.time.LocalDate;
5-
import java.time.ZonedDateTime;
65
import java.time.format.DateTimeFormatter;
76

87
import javax.swing.JComponent;
@@ -54,7 +53,7 @@ public void dateChanged(DateChangeEvent dateChangeEvent) {
5453
if (isoFormat) {
5554
editor.setText(date.format(DateTimeFormatter.ISO_DATE));
5655
} else {
57-
EasyDateFormat.fromTimeStampFormat(Globals.prefs.get(JabRefPreferences.TIME_STAMP_FORMAT)).getDateAt(ZonedDateTime.from(date));
56+
EasyDateFormat.fromTimeStampFormat(Globals.prefs.get(JabRefPreferences.TIME_STAMP_FORMAT)).getDateAt(date.atStartOfDay());
5857
}
5958
} else {
6059
// in this case the user selected "none" in the date picker, so we just clear the field

src/main/java/net/sf/jabref/logic/util/date/EasyDateFormat.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package net.sf.jabref.logic.util.date;
22

3-
import java.time.ZonedDateTime;
3+
import java.time.LocalDateTime;
44
import java.time.format.DateTimeFormatter;
55

66
public class EasyDateFormat {
@@ -27,7 +27,7 @@ public EasyDateFormat(DateTimeFormatter dateFormatter) {
2727
* @return The date string.
2828
*/
2929
public String getCurrentDate() {
30-
return getDateAt(ZonedDateTime.now());
30+
return getDateAt(LocalDateTime.now());
3131
}
3232

3333
/**
@@ -36,7 +36,7 @@ public String getCurrentDate() {
3636
*
3737
* @return The formatted date string.
3838
*/
39-
public String getDateAt(ZonedDateTime dateTime) {
39+
public String getDateAt(LocalDateTime dateTime) {
4040
// first use, create an instance
4141
return dateTime.format(dateFormatter);
4242
}

0 commit comments

Comments
 (0)