Skip to content

Commit

Permalink
Fixed stupid mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus committed Jul 22, 2016
1 parent 2725b32 commit 5b01ad4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/main/java/net/sf/jabref/gui/date/DatePickerButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/sf/jabref/logic/util/date/TimeStamp.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -19,7 +18,7 @@ public static boolean updateTimeStampIsSet(JabRefPreferences prefs) {
* Updates the timestamp of the given entry and returns the FieldChange
*/
public static Optional<FieldChange> 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);
}
Expand Down

0 comments on commit 5b01ad4

Please sign in to comment.