Skip to content

fix: remove outdated dateFormat/ dateTimeFormat from locale files #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
3 changes: 2 additions & 1 deletion src/PickerInput/Selector/hooks/useInputProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as React from 'react';
import type { SelectorProps } from '../../../interface';
import { formatValue } from '../../../utils/dateUtil';
import type { InputProps } from '../Input';
import { toArray } from '../../../utils/miscUtil';

export default function useInputProps<DateType extends object = any>(
props: Pick<
Expand Down Expand Up @@ -128,7 +129,7 @@ export default function useInputProps<DateType extends object = any>(
// ======================== Input =========================
const getInputProps = (index?: number): InputProps => {
function getProp<T>(propValue: T | T[]): T {
return index !== undefined ? propValue[index] : propValue;
return toArray(propValue)[index || 0];
Comment on lines 131 to +132
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI 挂了..
image

}

const pickedAttrs = pickAttrs(props, {
Expand Down
2 changes: 0 additions & 2 deletions src/locale/am_ET.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ const locale: Locale = {
yearSelect: 'አመት ምረጥ',
decadeSelect: 'አስርት አመታት ምረጥ',
yearFormat: 'YYYY',
dateFormat: 'D/M/YYYY',
dayFormat: 'D',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
monthBeforeYear: true,
previousMonth: 'ያለፈው ወር (PageUp)',
nextMonth: 'ቀጣይ ወር (PageDown)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/ar_EG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const locale: Locale = {
monthSelect: 'اختيار الشهر',
yearSelect: 'اختيار السنة',
decadeSelect: 'اختيار العقد',
dateFormat: 'M/D/YYYY',
dateTimeFormat: 'M/D/YYYY HH:mm:ss',
previousMonth: 'الشهر السابق (PageUp)',
nextMonth: 'الشهر التالى(PageDown)',
previousYear: 'العام السابق (Control + left)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/az_AZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ const locale: Locale = {
monthSelect: 'Ay seç',
yearSelect: 'il seç',
decadeSelect: 'Onillik seçin',
dateFormat: 'D.M.YYYY',
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
previousMonth: 'Əvvəlki ay (PageUp)',
nextMonth: 'Növbəti ay (PageDown)',
previousYear: 'Sonuncu il (Control + left)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/bg_BG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const locale: Locale = {
monthSelect: 'Избор на месец',
yearSelect: 'Избор на година',
decadeSelect: 'Десетилетие',
dateFormat: 'D M YYYY',
dateTimeFormat: 'D M YYYY HH:mm:ss',
previousMonth: 'Предишен месец (PageUp)',
nextMonth: 'Следващ месец (PageDown)',
previousYear: 'Последна година (Control + left)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/bn_BD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ const locale: Locale = {
monthSelect: 'মাস পছন্দ করুন',
yearSelect: 'বছর পছন্দ করুন',
decadeSelect: 'একটি দশক পছন্দ করুন',
dateFormat: 'M/D/YYYY',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
previousMonth: 'গত মাস (PageUp)',
nextMonth: 'আগামী মাস (PageDown)',
previousYear: 'গত বছর (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/by_BY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'Выбраць год',
decadeSelect: 'Выбраць дзесяцігоддзе',

dateFormat: 'D-M-YYYY',

dateTimeFormat: 'D-M-YYYY HH:mm:ss',

previousMonth: 'Папярэдні месяц (PageUp)',
nextMonth: 'Наступны месяц (PageDown)',
previousYear: 'Папярэдні год (Control + left)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/ca_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const locale: Locale = {
monthSelect: 'Escollir un mes',
yearSelect: 'Escollir un any',
decadeSelect: 'Escollir una dècada',
dateFormat: 'D/M/YYYY',
dateTimeFormat: 'D/M/YYYY HH:mm:ss',
previousMonth: 'Mes anterior (PageUp)',
nextMonth: 'Mes següent (PageDown)',
previousYear: 'Any anterior (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/cs_CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Vyberte rok',
decadeSelect: 'Vyberte dekádu',

dateFormat: 'D.M.YYYY',

dateTimeFormat: 'D.M.YYYY HH:mm:ss',

previousMonth: 'Předchozí měsíc (PageUp)',
nextMonth: 'Následující (PageDown)',
previousYear: 'Předchozí rok (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/da_DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Vælg år',
decadeSelect: 'Vælg årti',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Forrige måned (Page Up)',
nextMonth: 'Næste måned (Page Down)',
previousYear: 'Forrige år (Ctrl-venstre pil)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/de_DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Wähle ein Jahr',
decadeSelect: 'Wähle ein Jahrzehnt',

dateFormat: 'D.M.YYYY',

dateTimeFormat: 'D.M.YYYY HH:mm:ss',

previousMonth: 'Vorheriger Monat (PageUp)',
nextMonth: 'Nächster Monat (PageDown)',
previousYear: 'Vorheriges Jahr (Ctrl + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/el_GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Επιλογή έτους',
decadeSelect: 'Επιλογή δεκαετίας',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Προηγούμενος μήνας (PageUp)',
nextMonth: 'Επόμενος μήνας (PageDown)',
previousYear: 'Προηγούμενο έτος (Control + αριστερά)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/en_GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Choose a year',
decadeSelect: 'Choose a decade',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Previous month (PageUp)',
nextMonth: 'Next month (PageDown)',
previousYear: 'Last year (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'Choose a year',
decadeSelect: 'Choose a decade',

dateFormat: 'M/D/YYYY',

dateTimeFormat: 'M/D/YYYY HH:mm:ss',

previousMonth: 'Previous month (PageUp)',
nextMonth: 'Next month (PageDown)',
previousYear: 'Last year (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/es_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Elegir un año',
decadeSelect: 'Elegir una década',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Mes anterior (PageUp)',
nextMonth: 'Mes siguiente (PageDown)',
previousYear: 'Año anterior (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/es_MX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'Seleccionar año',
decadeSelect: 'Seleccionar década',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Mes anterior (PageUp)',
nextMonth: 'Mes siguiente (PageDown)',
previousYear: 'Año anterior (Control + Left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/et_EE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Vali aasta',
decadeSelect: 'Vali dekaad',

dateFormat: 'D.M.YYYY',

dateTimeFormat: 'D.M.YYYY HH:mm:ss',

previousMonth: 'Eelmine kuu (PageUp)',
nextMonth: 'Järgmine kuu (PageDown)',
previousYear: 'Eelmine aasta (Control + left)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/eu_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ const locale: Locale = {
monthSelect: 'Hilabetea aukeratu',
yearSelect: 'Urtea aukeratu',
decadeSelect: 'Hamarkada aukeratu',
dateFormat: 'YYYY/M/D',
dateTimeFormat: 'YYYY/M/D HH:mm:ss',
monthBeforeYear: false,
previousMonth: 'Aurreko hilabetea (RePag)',
nextMonth: 'Urrengo hilabetea (AvPag)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/fa_IR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'یک سال را انتخاب کنید',
decadeSelect: 'یک دهه را انتخاب کنید',

dateFormat: 'M/D/YYYY',

dateTimeFormat: 'M/D/YYYY HH:mm:ss',

previousMonth: 'ماه قبل (PageUp)',
nextMonth: 'ماه بعد (PageDown)',
previousYear: 'سال قبل (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/fi_FI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Valitse vuosi',
decadeSelect: 'Valitse vuosikymmen',

dateFormat: 'D.M.YYYY',

dateTimeFormat: 'D.M.YYYY HH:mm:ss',

previousMonth: 'Edellinen kuukausi (PageUp)',
nextMonth: 'Seuraava kuukausi (PageDown)',
previousYear: 'Edellinen vuosi (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/fr_BE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Choisissez une année',
decadeSelect: 'Choisissez une décennie',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Mois précédent (PageUp)',
nextMonth: 'Mois suivant (PageDown)',
previousYear: 'Année précédente (Ctrl + gauche)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/fr_CA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ const locale: Locale = {
yearSelect: 'Choisissez une année',
decadeSelect: 'Choisissez une décennie',

dateFormat: 'DD/MM/YYYY',
dayFormat: 'DD',
dateTimeFormat: 'DD/MM/YYYY HH:mm:ss',

previousMonth: 'Mois précédent (PageUp)',
nextMonth: 'Mois suivant (PageDown)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/fr_FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ const locale: Locale = {
yearSelect: 'Choisissez une année',
decadeSelect: 'Choisissez une décennie',

dateFormat: 'DD/MM/YYYY',
dayFormat: 'DD',
dateTimeFormat: 'DD/MM/YYYY HH:mm:ss',

previousMonth: 'Mois précédent (PageUp)',
nextMonth: 'Mois suivant (PageDown)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/ga_IE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'Roghnaigh bliain',
decadeSelect: 'Roghnaigh deich mbliana',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'An mhí roimhe seo (PageUp)',
nextMonth: 'An mhí seo chugainn (PageDown)',
previousYear: 'Anuraidh (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/gl_ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Elexir un año',
decadeSelect: 'Elexir unha década',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Mes anterior (PageUp)',
nextMonth: 'Mes seguinte (PageDown)',
previousYear: 'Ano anterior (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/he_IL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'בחר שנה',
decadeSelect: 'בחר עשור',

dateFormat: 'M/D/YYYY',

dateTimeFormat: 'M/D/YYYY HH:mm:ss',

previousMonth: 'חודש קודם (PageUp)',
nextMonth: 'חודש הבא (PageDown)',
previousYear: 'שנה שעברה (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/hi_IN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'एक वर्ष चुनें',
decadeSelect: 'एक दशक चुनें',

dateFormat: 'M/D/YYYY',

dateTimeFormat: 'M/D/YYYY HH:mm:ss',

previousMonth: 'पिछला महीना (पेजअप)',
nextMonth: 'अगले महीने (पेजडाउन)',
previousYear: 'पिछले साल (Ctrl + बाएं)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/hr_HR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'Odaberite godinu',
decadeSelect: 'Odaberite desetljeće',

dateFormat: 'D.M.YYYY',

dateTimeFormat: 'D.M.YYYY HH:mm:ss',

previousMonth: 'Prošli mjesec (PageUp)',
nextMonth: 'Sljedeći mjesec (PageDown)',
previousYear: 'Prošla godina (Control + left)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/hu_HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ const locale: Locale = {
yearSelect: 'Év kiválasztása', // 'Choose a year',
decadeSelect: 'Évtized kiválasztása', // 'Choose a decade',

dateFormat: 'YYYY/MM/DD', // 'M/D/YYYY',
dayFormat: 'DD', // 'D',
dateTimeFormat: 'YYYY/MM/DD HH:mm:ss', // 'M/D/YYYY HH:mm:ss',

previousMonth: 'Előző hónap (PageUp)', // 'Previous month (PageUp)',
nextMonth: 'Következő hónap (PageDown)', // 'Next month (PageDown)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/id_ID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'Pilih satu tahun',
decadeSelect: 'Pilih satu dekade',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Bulan sebelumnya (PageUp)',
nextMonth: 'Bulan selanjutnya (PageDown)',
previousYear: 'Tahun lalu (Control + kiri)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/is_IS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Velja ár',
decadeSelect: 'Velja áratug',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Fyrri mánuður (PageUp)',
nextMonth: 'Næsti mánuður (PageDown)',
previousYear: 'Fyrra ár (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/it_IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: "Seleziona l'anno",
decadeSelect: 'Seleziona il decennio',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Il mese scorso (PageUp)',
nextMonth: 'Il prossimo mese (PageDown)',
previousYear: "L'anno scorso (Control + sinistra)",
Expand Down
2 changes: 0 additions & 2 deletions src/locale/ja_JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const locale: Locale = {
yearSelect: '年を選択',
decadeSelect: '年代を選択',
yearFormat: 'YYYY年',
dateFormat: 'YYYY年M月D日',
dateTimeFormat: 'YYYY年M月D日 HH時mm分ss秒',
previousYear: '前年 (Controlを押しながら左キー)',
nextYear: '翌年 (Controlを押しながら右キー)',
previousDecade: '前の年代',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/ka_GE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ const locale: Locale = {
yearSelect: 'წლის არჩევა',
decadeSelect: 'ათწლეულის არჩევა',

dateFormat: 'M/D/YYYY',

dateTimeFormat: 'M/D/YYYY HH:mm:ss',

previousMonth: 'წინა თვე (PageUp)',
nextMonth: 'მომდევნო თვე (PageDown)',
previousYear: 'წინა წელი (Control + left)',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/kk_KZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Жылды таңдаңыз',
decadeSelect: 'Онжылды таңдаңыз',

dateFormat: 'D-M-YYYY',

dateTimeFormat: 'D-M-YYYY HH:mm:ss',

previousMonth: 'Алдыңғы ай (PageUp)',
nextMonth: 'Келесі ай (PageDown)',
previousYear: 'Алдыңғы жыл (Control + left)',
Expand Down
2 changes: 0 additions & 2 deletions src/locale/km_KH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const locale: Locale = {
yearSelect: 'ជ្រើសរើសឆ្នាំ',
decadeSelect: 'ជ្រើសរើសអាយុ',

dateFormat: 'YYYY-M-D',
dateTimeFormat: 'YYYY-M-D HH:mm:ss',
previousYear: 'ឆ្នាំមុន (Controlគ្រាប់ចុចបូកព្រួញខាងឆ្វេង)',
nextYear: 'ឆ្នាំក្រោយ (Control គ្រាប់ចុចបូកព្រួញស្ដាំ)',
previousDecade: 'ជំនាន់ចុងក្រោយ',
Expand Down
4 changes: 0 additions & 4 deletions src/locale/kmr_IQ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ const locale: Locale = {
yearSelect: 'Sal hilbijêre',
decadeSelect: 'Dehsal hilbijêre',

dateFormat: 'D/M/YYYY',

dateTimeFormat: 'D/M/YYYY HH:mm:ss',

previousMonth: 'Meha peş (PageUp))',
nextMonth: 'Meha paş (PageDown)',
previousYear: 'Sala peş (Control + şep)',
Expand Down
Loading