From b1a2bacddaa8b7e58ef5c564ad1e89c6531a1b41 Mon Sep 17 00:00:00 2001 From: Oscar Gustafsson Date: Sun, 17 Jul 2016 16:09:44 +0200 Subject: [PATCH] Fixed stupid mistake --- src/main/java/net/sf/jabref/gui/date/DatePickerButton.java | 7 ++++++- src/main/java/net/sf/jabref/logic/util/date/TimeStamp.java | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/date/DatePickerButton.java b/src/main/java/net/sf/jabref/gui/date/DatePickerButton.java index e3443e52f88b..d83123de2333 100644 --- a/src/main/java/net/sf/jabref/gui/date/DatePickerButton.java +++ b/src/main/java/net/sf/jabref/gui/date/DatePickerButton.java @@ -27,6 +27,7 @@ import javax.swing.JComponent; import javax.swing.JPanel; +import net.sf.jabref.Globals; import net.sf.jabref.gui.fieldeditors.FieldEditor; import net.sf.jabref.gui.util.FocusRequester; import net.sf.jabref.logic.util.date.EasyDateFormat; @@ -55,7 +56,11 @@ public DatePickerButton(FieldEditor pEditor, Boolean isoFormat) { public void actionPerformed(ActionEvent e) { Date date = datePicker.getDate(); if (date != null) { - editor.setText(EasyDateFormat.isoDateFormat().getDateAt(date)); + if (isoFormat) { + editor.setText(EasyDateFormat.isoDateFormat().getDateAt(date)); + } else { + editor.setText(EasyDateFormat.fromPreferences(Globals.prefs).getDateAt(date)); + } // Set focus to editor component after changing its text: new FocusRequester(editor.getTextComponent()); } diff --git a/src/main/java/net/sf/jabref/logic/util/date/TimeStamp.java b/src/main/java/net/sf/jabref/logic/util/date/TimeStamp.java index fcdc1771da5f..b2ac885a185b 100644 --- a/src/main/java/net/sf/jabref/logic/util/date/TimeStamp.java +++ b/src/main/java/net/sf/jabref/logic/util/date/TimeStamp.java @@ -2,7 +2,6 @@ import java.util.Optional; -import net.sf.jabref.Globals; import net.sf.jabref.logic.util.UpdateField; import net.sf.jabref.model.FieldChange; import net.sf.jabref.model.entry.BibEntry; @@ -19,7 +18,7 @@ public static boolean updateTimeStampIsSet(JabRefPreferences prefs) { * Updates the timestamp of the given entry and returns the FieldChange */ public static Optional doUpdateTimeStamp(BibEntry entry, JabRefPreferences prefs) { - String timeStampField = Globals.prefs.get(JabRefPreferences.TIME_STAMP_FIELD); + String timeStampField = prefs.get(JabRefPreferences.TIME_STAMP_FIELD); String timestamp = EasyDateFormat.fromPreferences(prefs).getCurrentDate(); return UpdateField.updateField(entry, timeStampField, timestamp); }