Skip to content

Date Format Issue #76

@hstoney

Description

@hstoney

Attempting to move to version 10.4.1 my dates using a Day Name format all appeared as invalid (red). It is OK with version 10.3.1.
I changed to passing a date formatter to setFormatForDatesCommonEra but tah did not resolve the issue.

Here is my code that fails ( with the original line commetted before trying a date formatter:

datePicker = new DatePicker((DatePickerSettings) null);
DatePickerSettings dateSettingsPgmDate = new DatePickerSettings();
dateSettingsPgmDate.setAllowEmptyDates(true);
// dateSettingsPgmDate.setFormatForDatesCommonEra("EEE, dd MMM yyyy");
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("EEE, dd MMM yyyy");
dateSettingsPgmDate.setFormatForDatesCommonEra(dateFormatter);
datePicker = new DatePicker(dateSettingsPgmDate);
datePicker.getComponentDateTextField().setEditable(false);
datePicker.getComponentDateTextField().setToolTipText("The earliest date for booking to display.");
datePicker.getComponentToggleCalendarButton().setToolTipText("The earliest date for booking to display.");
datePicker.getComponentToggleCalendarButton().setText("+");
datePicker.getComponentToggleCalendarButton().setFont(new Font("Arial", Font.PLAIN, 12));
datePicker.getComponentDateTextField().setHorizontalAlignment(SwingConstants.LEFT);
datePicker.getComponentDateTextField().setFont(new Font("Arial", Font.PLAIN, 12));
datePicker.getComponentDateTextField().setDisabledTextColor(Color.BLACK);
datePicker.setBounds(115, 50, 160, 20);
datePicker.setDateToToday();
datePicker.addDateChangeListener(new DatePickerChangeListener("datePicker"));
getContentPane().add(datePicker);

I suspect the fix for issue #60 may be the cause.

I will stick with version 10.3.1 as it is a good fit for my needs and I have found your date picker good to work with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions