vaadin / vaadin/framework

DateField: formatting of selected date ignores Locale

Open
#10,740 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

When I set the Locale globally in Vaadin and/or for a DateField locally, the dropdown is correctly localized but when I select a date, the formatting doesn't use my Locale but prints English weekday names. I would expect that the formatted date was also localized using the provided Locale.

example (also see attached example project datefield-bugdemo.zip)

The code
final DateField dateField = new DateField();
dateField.setLocale(new Locale("de", "DE"));
dateField.setDateFormat("EE, dd.MM.yyyy");
displays the dropdown correctly localized:
date-picker-open
but when selected, the date is not localized anymore:
date-selected

used versions

  • Vaadin Framework 8.3.2
  • Firefox 59.0.1
  • Spring Boot 2.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the attached datefield-bugdemo.zip with Vaadin Framework 8.3.2 and reproduce the difference between the localized dropdown and the selected-date display using DateField.setLocale(new Locale("de", "DE")) and setDateFormat("EE, dd.MM.yyyy"). Trace the DateField formatting path and verify that the selected date uses the provided locale, matching the dropdown's localization.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.