Skip to content

Commit

Permalink
feat(datepicker): added Hebrew locale support for datepicker (#2904)
Browse files Browse the repository at this point in the history
* added hebrew locale

* remove package lock
  • Loading branch information
msarsha authored and valorkin committed Nov 21, 2017
1 parent 3adf7c4 commit f2d5156
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
4 changes: 2 additions & 2 deletions demo/src/app/components/+datepicker/demo-datepicker.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { routes } from './demo-datepicker.routes';

import { defineLocale } 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
ar, cs, de, enGb, es, esDo, esUs, fr, hi, it, ja, ko, nl, nlBe, pl, ptBr, sv, ru, zhCn, tr, he
} 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];
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));

Expand Down
53 changes: 53 additions & 0 deletions src/bs-moment/i18n/he.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// moment.js locale configuration
// locale : Hebrew (Israel) [he]
// author : Matan Sar-Shalom : https://github.com/msarsha

import { LocaleData } from '../locale/locale.class';

export const he: LocaleData = {
abbr: 'he',
months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split(
'_'
),
monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יונ׳_יול׳_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split(
'_'
),
weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
weekdaysMin: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[היום ב] LT',
nextDay: '[מחר ב] LT',
nextWeek: 'dddd [ב] LT',
lastDay: '[אתמול ב] LT',
lastWeek: '[שבוע שעבר] dddd [ב] LT',
sameElse: 'L'
},
relativeTime: {
future: 'בעוד %s',
past: '%s לפני',
s: 'מספר שניות',
m: 'דקה',
mm: '%d דקות',
h: 'שעה',
hh: '%d שעות',
d: 'a יום',
dd: '%d ימים',
M: 'a חודש',
MM: '%d חודשים',
y: 'a שנה',
yy: '%d שנים'
},
week: {
dow: 0, // Sunday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
};
1 change: 1 addition & 0 deletions src/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ export { sv } from './bs-moment/i18n/sv';
export { ru } from './bs-moment/i18n/ru';
export { zhCn } from './bs-moment/i18n/zh-cn';
export { tr } from './bs-moment/i18n/tr';
export { he } from './bs-moment/i18n/he';

0 comments on commit f2d5156

Please sign in to comment.