From: Oire Date: Fri, 31 May 2013 11:20:23 +0000 (+0300) Subject: The only solution I can propose with processHours function X-Git-Tag: 2.1.0~29^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d42584f3ded91c2ae6af020623da8ae55853a385;p=thirdparty%2Fmoment.git The only solution I can propose with processHours function --- diff --git a/lang/uk.js b/lang/uk.js index fb40938c6..446d9f1a0 100644 --- a/lang/uk.js +++ b/lang/uk.js @@ -56,6 +56,12 @@ function weekdaysCaseReplace(m, format) { return weekdays[nounCase][m.day()]; } +function processHoursFunction(str) { + return function () { + return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; + }; +} + require('../moment').lang('uk', { months : monthsCaseReplace, monthsShort : "січ_лют_бер_кві_тра_чер_лип_сер_вер_жов_лис_гру".split("_"), @@ -70,29 +76,21 @@ require('../moment').lang('uk', { LLLL : "dddd, D MMMM YYYY р., LT" }, calendar : { - sameDay: function () { - return '[Сьогодні о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }, - nextDay: function () { - return '[Завтра о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }, - lastDay: function () { - return '[Вчора о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }, - nextWeek: function () { - return '[У] dddd [о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }, + sameDay: processHoursFunction('[Сьогодні '), + nextDay: processHoursFunction('[Завтра '), + lastDay: processHoursFunction('[Вчора '), + nextWeek: processHoursFunction('[У] dddd ['), lastWeek: function () { switch (this.day()) { case 0: case 3: case 5: case 6: - return '[Минулої] dddd [о' + (this.hours() === 11 ? 'б' : '') + '] LT'; + return '[Минулої] dddd [' + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; case 1: case 2: case 4: - return '[Минулого] dddd [о' + (this.hours() === 11 ? 'б' : '') + '] LT'; + return '[Минулого] dddd [' + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; } }, sameElse: 'L'