Skip to content

Commit

Permalink
use localdatetime instead of zonedDateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasgeiger committed Dec 19, 2016
1 parent 958c50f commit 4c11664
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/main/java/net/sf/jabref/gui/date/DatePickerButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.awt.BorderLayout;
import java.time.LocalDate;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

import javax.swing.JComponent;
Expand Down Expand Up @@ -54,7 +53,7 @@ public void dateChanged(DateChangeEvent dateChangeEvent) {
if (isoFormat) {
editor.setText(date.format(DateTimeFormatter.ISO_DATE));
} else {
EasyDateFormat.fromTimeStampFormat(Globals.prefs.get(JabRefPreferences.TIME_STAMP_FORMAT)).getDateAt(ZonedDateTime.from(date));
EasyDateFormat.fromTimeStampFormat(Globals.prefs.get(JabRefPreferences.TIME_STAMP_FORMAT)).getDateAt(date.atStartOfDay());
}
} else {
// in this case the user selected "none" in the date picker, so we just clear the field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.sf.jabref.logic.util.date;

import java.time.ZonedDateTime;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class EasyDateFormat {
Expand All @@ -27,7 +27,7 @@ public EasyDateFormat(DateTimeFormatter dateFormatter) {
* @return The date string.
*/
public String getCurrentDate() {
return getDateAt(ZonedDateTime.now());
return getDateAt(LocalDateTime.now());
}

/**
Expand All @@ -36,7 +36,7 @@ public String getCurrentDate() {
*
* @return The formatted date string.
*/
public String getDateAt(ZonedDateTime dateTime) {
public String getDateAt(LocalDateTime dateTime) {
// first use, create an instance
return dateTime.format(dateFormatter);
}
Expand Down

0 comments on commit 4c11664

Please sign in to comment.