| 1 |
//! moment.js locale configuration |
| 2 |
//! locale : Greek [el] |
| 3 |
//! author : Aggelos Karalias : https://github.com/mehiel |
| 4 |
|
| 5 |
import moment from '../moment'; |
| 6 |
|
| 7 |
function isFunction(input) { |
| 8 |
return ( |
| 9 |
(typeof Function !== 'undefined' && input instanceof Function) || |
| 10 |
Object.prototype.toString.call(input) === '[object Function]' |
| 11 |
); |
| 12 |
} |
| 13 |
|
| 14 |
export default moment.defineLocale('el', { |
| 15 |
monthsNominativeEl: |
| 16 |
'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split( |
| 17 |
'_' |
| 18 |
), |
| 19 |
monthsGenitiveEl: |
| 20 |
'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split( |
| 21 |
'_' |
| 22 |
), |
| 23 |
months: function (momentToFormat, format) { |
| 24 |
if (!momentToFormat) { |
| 25 |
return this._monthsNominativeEl; |
| 26 |
} else if ( |
| 27 |
typeof format === 'string' && |
| 28 |
/D/.test(format.substring(0, format.indexOf('MMMM'))) |
| 29 |
) { |
| 30 |
// if there is a day number before 'MMMM' |
| 31 |
return this._monthsGenitiveEl[momentToFormat.month()]; |
| 32 |
} else { |
| 33 |
return this._monthsNominativeEl[momentToFormat.month()]; |
| 34 |
} |
| 35 |
}, |
| 36 |
monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'), |
| 37 |
weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split( |
| 38 |
'_' |
| 39 |
), |
| 40 |
weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'), |
| 41 |
weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'), |
| 42 |
meridiem: function (hours, minutes, isLower) { |
| 43 |
if (hours > 11) { |
| 44 |
return isLower ? 'μμ' : 'ΜΜ'; |
| 45 |
} else { |
| 46 |
return isLower ? 'πμ' : 'ΠΜ'; |
| 47 |
} |
| 48 |
}, |
| 49 |
isPM: function (input) { |
| 50 |
return (input + '').toLowerCase()[0] === 'μ'; |
| 51 |
}, |
| 52 |
meridiemParse: /[ΠΜ]\.?Μ?\.?/i, |
| 53 |
longDateFormat: { |
| 54 |
LT: 'h:mm A', |
| 55 |
LTS: 'h:mm:ss A', |
| 56 |
L: 'DD/MM/YYYY', |
| 57 |
LL: 'D MMMM YYYY', |
| 58 |
LLL: 'D MMMM YYYY h:mm A', |
| 59 |
LLLL: 'dddd, D MMMM YYYY h:mm A', |
| 60 |
}, |
| 61 |
calendarEl: { |
| 62 |
sameDay: '[Σήμερα {}] LT', |
| 63 |
nextDay: '[Αύριο {}] LT', |
| 64 |
nextWeek: 'dddd [{}] LT', |
| 65 |
lastDay: '[Χθες {}] LT', |
| 66 |
lastWeek: function () { |
| 67 |
switch (this.day()) { |
| 68 |
case 6: |
| 69 |
return '[το προηγούμενο] dddd [{}] LT'; |
| 70 |
default: |
| 71 |
return '[την προηγούμενη] dddd [{}] LT'; |
| 72 |
} |
| 73 |
}, |
| 74 |
sameElse: 'L', |
| 75 |
}, |
| 76 |
calendar: function (key, mom) { |
| 77 |
var output = this._calendarEl[key], |
| 78 |
hours = mom && mom.hours(); |
| 79 |
if (isFunction(output)) { |
| 80 |
output = output.apply(mom); |
| 81 |
} |
| 82 |
return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις'); |
| 83 |
}, |
| 84 |
relativeTime: { |
| 85 |
future: 'σε %s', |
| 86 |
past: '%s πριν', |
| 87 |
s: 'λίγα δευτερόλεπτα', |
| 88 |
ss: '%d δευτερόλεπτα', |
| 89 |
m: 'ένα λεπτό', |
| 90 |
mm: '%d λεπτά', |
| 91 |
h: 'μία ώρα', |
| 92 |
hh: '%d ώρες', |
| 93 |
d: 'μία μέρα', |
| 94 |
dd: '%d μέρες', |
| 95 |
M: 'ένας μήνας', |
| 96 |
MM: '%d μήνες', |
| 97 |
y: 'ένας χρόνος', |
| 98 |
yy: '%d χρόνια', |
| 99 |
}, |
| 100 |
dayOfMonthOrdinalParse: /\d{1,2}η/, |
| 101 |
ordinal: '%dη', |
| 102 |
week: { |
| 103 |
dow: 1, // Monday is the first day of the week. |
| 104 |
doy: 4, // The week that contains Jan 4st is the first week of the year. |
| 105 |
}, |
| 106 |
}); |