Skip to content

Commit

Permalink
[locale] tr: Add meridiem support (moment#4701)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zindev authored May 19, 2020
1 parent e3baef9 commit 22bf4ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/locale/tr.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ export default moment.defineLocale('tr', {
),
weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
meridiem: function (hours, minutes, isLower) {
if (hours < 12) {
return isLower ? 'öö' : 'ÖÖ';
} else {
return isLower ? 'ös' : 'ÖS';
}
},
meridiemParse: /öö|ÖÖ|ös|ÖS/,
isPM: function (input) {
return input === 'ös' || input === 'ÖS';
},
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
Expand Down
6 changes: 3 additions & 3 deletions src/test/locale/tr.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ test('format', function (assert) {
var a = [
[
'dddd, MMMM Do YYYY, h:mm:ss a',
'Pazar, Şubat 14 2010, 3:25:50 pm',
'Pazar, Şubat 14 2010, 3:25:50 ös',
],
['ddd, hA', 'Paz, 3PM'],
['ddd, hA', 'Paz, 3ÖS'],
['M Mo MM MMMM MMM', "2 2'nci 02 Şubat Şub"],
['YYYY YY', '2010 10'],
['D Do DD', '14 14 14'],
Expand All @@ -62,7 +62,7 @@ test('format', function (assert) {
['H HH', '15 15'],
['m mm', '25 25'],
['s ss', '50 50'],
['a A', 'pm PM'],
['a A', 'ös ÖS'],
['[yılın] DDDo [günü]', "yılın 45'inci günü"],
['LTS', '15:25:50'],
['L', '14.02.2010'],
Expand Down

0 comments on commit 22bf4ca

Please sign in to comment.