-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datepicker): added Thai locale support for datepicker (#3409)
* feat(datepicker): added Thai locale support for datepicker * feat(datepicker): export Thai locale support for datepicker in index.ts
- Loading branch information
Showing
4 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// moment.js locale configuration | ||
// locale : Thai [th] | ||
// author : Watcharapol Sanitwong : https://github.com/tumit | ||
|
||
import { LocaleData } from '../locale/locale.class'; | ||
|
||
export const th: LocaleData = { | ||
abbr: 'th', | ||
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 เวลา H:mm', | ||
LLLL : 'วันddddที่ D MMMM YYYY เวลา H:mm' | ||
}, | ||
meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/, | ||
isPM(input: string): boolean { | ||
return input === 'หลังเที่ยง'; | ||
}, | ||
meridiem(hour: number, minute: number, isLower:boolean) { | ||
return (hour < 12) ? 'ก่อนเที่ยง' : 'หลังเที่ยง'; | ||
}, | ||
calendar: { | ||
sameDay : '[วันนี้ เวลา] LT', | ||
nextDay : '[พรุ่งนี้ เวลา] LT', | ||
nextWeek : 'dddd[หน้า เวลา] LT', | ||
lastDay : '[เมื่อวานนี้ เวลา] LT', | ||
lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT', | ||
sameElse: 'L' | ||
}, | ||
relativeTime: { | ||
future : 'อีก %s', | ||
past : '%sที่แล้ว', | ||
s : 'ไม่กี่วินาที', | ||
ss : '%d วินาที', | ||
m : '1 นาที', | ||
mm : '%d นาที', | ||
h : '1 ชั่วโมง', | ||
hh : '%d ชั่วโมง', | ||
d : '1 วัน', | ||
dd : '%d วัน', | ||
M : '1 เดือน', | ||
MM : '%d เดือน', | ||
y : '1 ปี', | ||
yy : '%d ปี' | ||
}, | ||
week: { | ||
dow: 0, // Sunday is the first day of the week. | ||
doy: 12 // The week that contains Jan 1st is the first week of the year. | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,5 +177,6 @@ export { | |
ru, | ||
sv, | ||
zhCn, | ||
tr | ||
tr, | ||
th | ||
} from './locale'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters