diff --git a/demo/src/app/components/+datepicker/demo-datepicker.module.ts b/demo/src/app/components/+datepicker/demo-datepicker.module.ts index 553eefa2ae..01e93e671f 100644 --- a/demo/src/app/components/+datepicker/demo-datepicker.module.ts +++ b/demo/src/app/components/+datepicker/demo-datepicker.module.ts @@ -10,14 +10,13 @@ import { DatepickerSectionComponent } from './datepicker-section.component'; import { DEMO_COMPONENTS } from './demos'; import { routes } from './demo-datepicker.routes'; -import { defineLocale } from 'ngx-bootstrap/bs-moment'; +import { defineLocale, LocaleData } from 'ngx-bootstrap/bs-moment'; import { - ar, cs, de, enGb, es, esDo, esUs, fr, hi, it, ja, ko, nl, nlBe, pl, ptBr, sv, ru, zhCn, tr, he + ar, cs, de, enGb, es, esDo, esUs, fr, hi, it, ja, ko, nl, nlBe, pl, ptBr, sv, ru, zhCn, tr } from 'ngx-bootstrap/locale'; -const locales = [ar, cs, de, enGb, es, esDo, esUs, fr, hi, it, ja, ko, nl, nlBe, pl, ptBr, sv, ru, zhCn, tr, he]; - -locales.forEach(locale => defineLocale(locale.abbr, locale)); +const locales = [ar, cs, de, enGb, es, esDo, esUs, fr, hi, hu, it, ja, ko, nl, nlBe, pl, ptBr, sv, ru, zhCn, tr, he]; +locales.forEach((locale: LocaleData) => defineLocale(locale.abbr, locale)); @NgModule({ declarations: [ diff --git a/src/bs-moment/i18n/hu.ts b/src/bs-moment/i18n/hu.ts new file mode 100644 index 0000000000..0fa413e039 --- /dev/null +++ b/src/bs-moment/i18n/hu.ts @@ -0,0 +1,51 @@ +// moment.js locale configuration +// locale : Hungarian [hu] +// author : Gergely Padányi-Gulyás : https://github.com/fegyi001 + +import { LocaleData } from '../locale/locale.class'; + +export const hu = { + abbr: 'hu', + months: 'Január_Február_Március_Április_Május_Június_Július_Augusztus_Szeptember_Október_November_December'.split('_'), + monthsShort: 'Jan_Feb_Márc_Ápr_Máj_Jún_Júl_Aug_Szept_Okt_Nov_Dec'.split('_'), + weekdays: 'Vasárnap_Hétfő_Kedd_Szerda_Csütörtök_Péntek_Szombat'.split('_'), + weekdaysShort: 'Vas_Hét_Kedd_Sze_Csüt_Pén_Szo'.split('_'), + weekdaysMin: 'V_H_K_Sze_Cs_P_Szo'.split('_'), + longDateFormat: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'YYYY.MM.DD.', + LL: 'YYYY. MMMM D.', + LLL: 'YYYY. MMMM D. H:mm', + LLLL: 'YYYY. MMMM D., dddd H:mm' + }, + calendar: { + sameDay: '[Ma] LT[-kor]', + nextDay: '[Holnap] LT[-kor]', + nextWeek: 'dddd [] LT', + lastDay: '[Tegnap] LT', + lastWeek: '[Múlt] dddd [] LT', + sameElse: 'L' + }, + relativeTime: { + future: '%s múlva', + past: '%s', + s: 'néhány másodperce', + m: 'egy perce', + mm: '%d perce', + h: 'egy órája', + hh: '%d órája', + d: 'egy napja', + dd: '%d napja', + M: 'egy hónapja', + MM: '%d hónapja', + y: 'egy éve', + yy: '%d éve' + }, + dayOfMonthOrdinalParse: /\d{1,2}\./, + ordinal: '%d.', + week: { + dow: 1, + doy: 4 // The week that contains Jan 4th is the first week of the year. + } +}; diff --git a/src/bs-moment/index.ts b/src/bs-moment/index.ts index b637424e29..06e1a6caf9 100644 --- a/src/bs-moment/index.ts +++ b/src/bs-moment/index.ts @@ -3,3 +3,4 @@ export { getSetGlobalLocale, listLocales } from './locale/locales.service'; +export { LocaleData } from './locale/locale.class'; diff --git a/src/index.ts b/src/index.ts index 214fb57dcb..3d1e2c0c87 100644 --- a/src/index.ts +++ b/src/index.ts @@ -154,7 +154,7 @@ export { positionElements } from './positioning'; -export { defineLocale, getSetGlobalLocale } from './bs-moment'; +export { defineLocale, getSetGlobalLocale, LocaleData } from './bs-moment'; export { ar, @@ -166,6 +166,7 @@ export { esUs, fr, hi, + hu, it, ja, ko, diff --git a/src/locale.ts b/src/locale.ts index c467e4bf7f..1fa9d50b99 100644 --- a/src/locale.ts +++ b/src/locale.ts @@ -7,6 +7,7 @@ export { esDo } from './bs-moment/i18n/es-do'; export { esUs } from './bs-moment/i18n/es-us'; export { fr } from './bs-moment/i18n/fr'; export { hi } from './bs-moment/i18n/hi'; +export { hu } from './bs-moment/i18n/hu'; export { it } from './bs-moment/i18n/it'; export { ja } from './bs-moment/i18n/ja'; export { ko } from './bs-moment/i18n/ko';