Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class ClassicCalendarPanel extends JPanel implements

private JButton fastNextButton;

private static final int JAVA_MAJOR_VERSION = Integer.parseInt(System.getProperty("java.version").split("\\.|_|-b")[1]);

public ClassicCalendarPanel(Date aDate, Locale aLocale, TimeZone zone) {
this.locale = aLocale;
this.zone = zone;
Expand Down Expand Up @@ -159,7 +161,7 @@ private void createLocaleAndZoneSensitive() {
} else
calendar = Calendar.getInstance(zone, locale);

format = new SimpleDateFormat("MMMMM yyyy", locale);
format = new SimpleDateFormat(JAVA_MAJOR_VERSION >= 8 ? "LLLL yyyy" : "MMMMM yyyy", locale);
format.setTimeZone(zone);

setPreferredLabelSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ class MonthComboBoxRenderer extends DefaultListCellRenderer {

private SimpleDateFormat dateFormat;

private static final int JAVA_MAJOR_VERSION = Integer.parseInt(System.getProperty("java.version").split("\\.|_|-b")[1]);

public MonthComboBoxRenderer(Locale locale, TimeZone zone) {
// this.locale = locale;
this.zone = zone;
dateFormat = new SimpleDateFormat("MMMM", locale);
dateFormat = new SimpleDateFormat(JAVA_MAJOR_VERSION >= 8 ? "LLLL" : "MMMM", locale);
dateFormat.setTimeZone(zone);
}

Expand All @@ -37,7 +39,7 @@ public Component getListCellRendererComponent(JList list, Object value,

public void setLocale(Locale locale) {
// this.locale = locale;
dateFormat = new SimpleDateFormat("MMMM", locale);
dateFormat = new SimpleDateFormat(JAVA_MAJOR_VERSION >= 8 ? "LLLL" : "MMMM", locale);
dateFormat.setTimeZone(zone);
}

Expand Down