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 17, 2016
1 parent c4987d8 commit 15d6001
Showing 1 changed file with 6 additions and 1 deletion.
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

0 comments on commit 15d6001

Please sign in to comment.