Skip to content

Commit 6ce176b

Browse files
authored
♻️ chore(locale): replace the deprecated API (ant-design#52960)
* fix(local): enhance code robustness * chore: rename * chore: 移除不必要的 memo * chore: components/date-picker/locale/example.json添加注释 * chore: 注释 * Revert "fix(local): enhance code robustness" This reverts commit c199788. # Conflicts: # components/locale/useLocale.ts * ♻️ clean: deprecated api * chore: revert change * revert * chore: remove outdated api * chore: 移除冗余配置 * chore: replace deprecated api * chore: remove invalid * Revert "chore: replace deprecated api" This reverts commit 9765043. * chore: update * chore: remove mark
1 parent ad2db2a commit 6ce176b

File tree

7 files changed

+22
-26
lines changed

7 files changed

+22
-26
lines changed

components/date-picker/generatePicker/interface.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,27 @@ export type PickerLocale = {
2020
timePickerLocale: TimePickerLocale;
2121
} & AdditionalPickerLocaleProps;
2222

23+
/** @deprecated **Useless**. */
2324
export type AdditionalPickerLocaleProps = {
25+
/**
26+
* @deprecated **Invalid**, Please use `lang.fieldDateFormat` instead.
27+
* @see [Migration Guide](https://github.com/ant-design/ant-design/discussions/53011)
28+
*/
2429
dateFormat?: string;
30+
/**
31+
* @deprecated **Invalid**, Please use `lang.fieldDateTimeFormat` instead,
32+
* @see [Migration Guide](https://github.com/ant-design/ant-design/discussions/53011)
33+
*/
2534
dateTimeFormat?: string;
35+
/**
36+
* @deprecated **Invalid**, Please use `lang.fieldWeekFormat` instead,
37+
* @see [Migration Guide](https://github.com/ant-design/ant-design/discussions/53011)
38+
*/
2639
weekFormat?: string;
40+
/**
41+
* @deprecated **Invalid**, Please use `lang.fieldWeekFormat` instead,
42+
* @see [Migration Guide](https://github.com/ant-design/ant-design/discussions/53011)
43+
*/
2744
monthFormat?: string;
2845
};
2946

components/date-picker/locale/ar_EG.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ const locale: PickerLocale = {
99
placeholder: 'اختيار التاريخ',
1010
rangePlaceholder: ['البداية', 'النهاية'],
1111
yearFormat: 'YYYY',
12-
dateFormat: 'D/M/YYYY',
13-
dayFormat: 'D',
14-
dateTimeFormat: 'DD/MM/YYYY HH:mm:ss',
1512
monthFormat: 'MMMM',
1613
monthBeforeYear: true,
1714
shortWeekDays: ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
@@ -34,10 +31,6 @@ const locale: PickerLocale = {
3431
timePickerLocale: {
3532
...TimePickerLocale,
3633
},
37-
dateFormat: 'DD-MM-YYYY',
38-
monthFormat: 'MM-YYYY',
39-
dateTimeFormat: 'DD-MM-YYYY HH:mm:ss',
40-
weekFormat: 'wo-YYYY',
4134
};
4235

4336
// All settings at:

components/date-picker/locale/example.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
"yearSelect": "Choose a year",
1717
"decadeSelect": "Choose a decade",
1818
"yearFormat": "YYYY",
19-
"dateFormat": "M/D/YYYY",
20-
"dayFormat": "D",
21-
"dateTimeFormat": "M/D/YYYY HH:mm:ss",
19+
"fieldDateFormat": "M/D/YYYY",
20+
"cellDateFormat": "D",
21+
"fieldDateTimeFormat": "M/D/YYYY HH:mm:ss",
2222
"monthFormat": "MMMM",
23+
"fieldWeekFormat": "YYYY-wo",
2324
"monthBeforeYear": true,
2425
"previousMonth": "Previous month (PageUp)",
2526
"nextMonth": "Next month (PageDown)",
@@ -47,9 +48,5 @@
4748
},
4849
"timePickerLocale": {
4950
"placeholder": "Select time"
50-
},
51-
"dateFormat": "YYYY-MM-DD",
52-
"dateTimeFormat": "YYYY-MM-DD HH:mm:ss",
53-
"weekFormat": "YYYY-wo",
54-
"monthFormat": "YYYY-MM"
51+
}
5552
}

components/date-picker/locale/pl_PL.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ const locale: PickerLocale = {
99
placeholder: 'Wybierz datę',
1010
rangePlaceholder: ['Data początkowa', 'Data końcowa'],
1111
yearFormat: 'YYYY',
12-
dateFormat: 'M/D/YYYY',
13-
dayFormat: 'D',
14-
dateTimeFormat: 'M/D/YYYY HH:mm:ss',
1512
monthFormat: 'MMMM',
1613
monthBeforeYear: true,
1714
shortWeekDays: ['Niedz', 'Pon', 'Wt', 'Śr', 'Czw', 'Pt', 'Sob'],

components/date-picker/locale/pt_PT.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ const locale: PickerLocale = {
2222
yearSelect: 'Selecionar ano',
2323
decadeSelect: 'Selecionar década',
2424
yearFormat: 'YYYY',
25-
dateFormat: 'D/M/YYYY',
26-
dayFormat: 'D',
27-
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
2825
monthFormat: 'MMMM',
2926
monthBeforeYear: false,
3027
previousMonth: 'Mês anterior (PageUp)',

components/date-picker/locale/sl_SI.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ const locale: PickerLocale = {
2121
yearSelect: 'Izberite leto',
2222
decadeSelect: 'Izberite desetletje',
2323
yearFormat: 'YYYY',
24-
dateFormat: 'D.M.YYYY',
25-
dayFormat: 'D',
26-
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
2724
monthFormat: 'MMMM',
2825
monthBeforeYear: true,
2926
previousMonth: 'Prejšnji mesec (PageUp)',

components/locale/hy_AM.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ const datePickerLocale: PickerLocale = {
2121
yearSelect: 'Ընտրեք տարին',
2222
decadeSelect: 'Ընտրեք տասնամյակը',
2323
yearFormat: 'YYYY',
24-
dateFormat: 'DD/MM//YYYY',
2524
dayFormat: 'DD',
26-
dateTimeFormat: 'DD/MM//YYYY HH:mm:ss',
2725
monthBeforeYear: true,
2826
previousMonth: 'Անցած ամիս (PageUp)',
2927
nextMonth: 'Մյուս ամիս (PageDown)',

0 commit comments

Comments
 (0)