Skip to content

Commit 22bf4ca

Browse files
authored
[locale] tr: Add meridiem support (#4701)
1 parent e3baef9 commit 22bf4ca

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/locale/tr.js

+11
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ export default moment.defineLocale('tr', {
3636
),
3737
weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
3838
weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
39+
meridiem: function (hours, minutes, isLower) {
40+
if (hours < 12) {
41+
return isLower ? 'öö' : 'ÖÖ';
42+
} else {
43+
return isLower ? 'ös' : 'ÖS';
44+
}
45+
},
46+
meridiemParse: /öö|ÖÖ|ös|ÖS/,
47+
isPM: function (input) {
48+
return input === 'ös' || input === 'ÖS';
49+
},
3950
longDateFormat: {
4051
LT: 'HH:mm',
4152
LTS: 'HH:mm:ss',

src/test/locale/tr.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ test('format', function (assert) {
4949
var a = [
5050
[
5151
'dddd, MMMM Do YYYY, h:mm:ss a',
52-
'Pazar, Şubat 14 2010, 3:25:50 pm',
52+
'Pazar, Şubat 14 2010, 3:25:50 ös',
5353
],
54-
['ddd, hA', 'Paz, 3PM'],
54+
['ddd, hA', 'Paz, 3ÖS'],
5555
['M Mo MM MMMM MMM', "2 2'nci 02 Şubat Şub"],
5656
['YYYY YY', '2010 10'],
5757
['D Do DD', '14 14 14'],
@@ -62,7 +62,7 @@ test('format', function (assert) {
6262
['H HH', '15 15'],
6363
['m mm', '25 25'],
6464
['s ss', '50 50'],
65-
['a A', 'pm PM'],
65+
['a A', 'ös ÖS'],
6666
['[yılın] DDDo [günü]', "yılın 45'inci günü"],
6767
['LTS', '15:25:50'],
6868
['L', '14.02.2010'],

0 commit comments

Comments
 (0)