igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

[igx-date-picker] unnecessary suffix "日" to the date part of the calendar.

Open tkiryu opened this issue 7 years ago • 3 comments

Description

I'm trying to localize igx-date-picker to Japanese locale. I found that the formatting of date part is not what Japanese people expect. Until v7.1.9, there is no problem.

  • igniteui-angular version: 7.2.0-rc.3
  • browser: N/A

Steps to reproduce

  1. Go to https://stackblitz.com/edit/igx-date-picker-template-issue
  2. Show the dialog mode datepicker.
  3. Show the dropdown mode datepicker.

Result

"日" is suffixed to each date number. image

Expected result

"日" should be removed. igx-date-picker should format date parts as before. image

Attachments

https://stackblitz.com/edit/igx-date-picker-template-issue

tkiryu avatar Mar 08 '19 07:03 tkiryu

Hello Tatsushi, igx-calendar uses Intl.DateTimeFormat for formatting dates according to the set locale. I’ve tested the day formatting for ja locale and 日 appears always. If you test this: const formatter = new Intl.DateTimeFormat("ja", { day: 'numeric' }); const day = formatter.format(new Date(2019,2,10)); the returned formatted date is 10日.

https://stackblitz.com/edit/igx-date-picker-template-issue-djqt2h?file=src%2Fapp%2Fapp.component.html

sboykova avatar Mar 12 '19 09:03 sboykova

@tkiryu, your problem is partially fixed by #4195. Currently there are two properties that take care of formatting the views: formatViews and FormatOptions. As far as you use the default formatViews settings, where the days are not affected, you will have the desired display, as in the use case from your sample. Otherwise, as @sboykova has explained, Intl.DateTimeFormat will append the 日 and unfortunately we cannot do much about it.

SAndreeva avatar Mar 12 '19 10:03 SAndreeva

@SAndreeva , @sboykova , is it possible not to use Intl.DateTimeFormat for formatting dates?

Why I'm thinking of that is because previous versions are able to achieve what Japanese people expect. Therefore, my feeling is that this issue is a kind of regression bug.

Please see igx-date-picker using [email protected]. The result of this sample is what Japanese people expect. https://stackblitz.com/edit/igx-date-picker-v7-1-9

By the way, there is no problem with localization of igDatePicker. https://jp.igniteui.com/editors/date-picker-new

tkiryu avatar Mar 14 '19 09:03 tkiryu