Skip to content

Commit

Permalink
feat(datepicker) add georgian locale (#5556)
Browse files Browse the repository at this point in the history
  • Loading branch information
tskipa authored and daniloff200 committed Jan 14, 2020
1 parent 00037ef commit 243d3b8
Show file tree
Hide file tree
Showing 6 changed files with 333 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 @@ -8,7 +8,7 @@ import { BsDatepickerModule, DatepickerModule } from 'ngx-bootstrap/datepicker';

import {
arLocale, bgLocale, caLocale, csLocale, daLocale, deLocale, enGbLocale, esDoLocale, esLocale, esUsLocale, etLocale, frLocale, heLocale,
hiLocale, hrLocale, fiLocale, glLocale, huLocale, idLocale, itLocale, jaLocale, koLocale, ltLocale, lvLocale, mnLocale, nbLocale,
hiLocale, hrLocale, fiLocale, glLocale, huLocale, idLocale, itLocale, jaLocale, kaLocale, koLocale, ltLocale, lvLocale, mnLocale, nbLocale,
nlBeLocale, nlLocale, plLocale, ptBrLocale, ruLocale, roLocale, skLocale, slLocale, svLocale, thLocale, trLocale, viLocale,
zhCnLocale, ukLocale
} from 'ngx-bootstrap/locale';
Expand All @@ -22,7 +22,7 @@ import { DEMO_COMPONENTS } from './demos';

const locales = [
arLocale, bgLocale, caLocale, csLocale, daLocale, deLocale, enGbLocale, esDoLocale, esLocale, esUsLocale, etLocale, frLocale,
heLocale, hiLocale, hrLocale, fiLocale, glLocale, huLocale, idLocale, itLocale, jaLocale, koLocale, ltLocale, lvLocale, mnLocale,
heLocale, hiLocale, hrLocale, fiLocale, glLocale, huLocale, idLocale, itLocale, jaLocale, kaLocale, koLocale, ltLocale, lvLocale, mnLocale,
nbLocale, nlBeLocale, nlLocale, plLocale, ptBrLocale, ruLocale, roLocale, skLocale, slLocale, svLocale, thLocale,
trLocale, ukLocale, viLocale, zhCnLocale
];
Expand Down
90 changes: 90 additions & 0 deletions src/chronos/i18n/ka.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// tslint:disable:comment-format binary-expression-operand-order max-line-length
// tslint:disable:no-bitwise prefer-template cyclomatic-complexity
// tslint:disable:no-shadowed-variable switch-default prefer-const
// tslint:disable:one-variable-per-declaration newline-before-return

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

//! moment.js locale configuration
//! locale : Georgian [ka]
//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili
//! author : Levan Tskipuri : https://github.com/tskipa

export const kaLocale: LocaleData = {
abbr: 'ka',
months : {
format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_'),
standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_')
},
monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
weekdays : {
standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'),
format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'),
isFormat: /(|)/
},
weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendar : {
sameDay : '[დღეს] LT[-ზე]',
nextDay : '[ხვალ] LT[-ზე]',
lastDay : '[გუშინ] LT[-ზე]',
nextWeek : '[შემდეგ] dddd LT[-ზე]',
lastWeek : '[წინა] dddd LT-ზე',
sameElse : 'L'
},
relativeTime : {
future(s: number): string {
var st = s.toString();
return (/(|||)/).test(st) ?
st.replace(/$/, 'ში') :
st + 'ში';
},
past(s: number): string {
var st = s.toString();
if ((/(||||)/).test(st)) {
return st.replace(/(|)$/, 'ის წინ');
}
if ((//).test(st)) {
return st.replace(/$/, 'წლის წინ');
}
},
s : 'რამდენიმე წამი',
ss : '%d წამი',
m : 'წუთი',
mm : '%d წუთი',
h : 'საათი',
hh : '%d საათი',
d : 'დღე',
dd : '%d დღე',
M : 'თვე',
MM : '%d თვე',
y : 'წელი',
yy : '%d წელი'
},
dayOfMonthOrdinalParse: /0|1-|-\d{1,2}|\d{1,2}-/,
ordinal(_num: number, _period: string): string {
const num = Number(_num);
if (num === 0) {
return num.toString();
}
if (num === 1) {
return num + '-ლი';
}
if ((num < 20) || (num <= 100 && (num % 20 === 0)) || (num % 100 === 0)) {
return 'მე-' + num;
}
return num + '-ე';
},
week : {
dow : 1,
doy : 4
}
};
1 change: 1 addition & 0 deletions src/chronos/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export { hrLocale } from './i18n/hr';
export { idLocale } from './i18n/id';
export { itLocale } from './i18n/it';
export { jaLocale } from './i18n/ja';
export { kaLocale } from './i18n/ka';
export { koLocale } from './i18n/ko';
export { ltLocale } from './i18n/lt';
export { lvLocale } from './i18n/lv';
Expand Down
Loading

0 comments on commit 243d3b8

Please sign in to comment.