summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-15 13:52:56 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-15 13:52:56 +0200
commit506dc652ff9fd76fde684f621cda2fa2783313a4 (patch)
tree1315991537367b014534903786041a53a8fc650f
parent360966ab4bdafd15cdef21e34492f5d7d3151b74 (diff)
add support for relative dates, fix #28
-rw-r--r--js/Gruntfile.coffee2
-rw-r--r--js/app/controllers/itemcontroller.coffee10
-rw-r--r--js/app/services/language.coffee8
-rw-r--r--js/app/services/moment.coffee0
-rw-r--r--js/app/services/services.coffee1
-rw-r--r--js/config/testacular_conf.js1
-rw-r--r--js/public/app.js21
-rw-r--r--js/tests/services/languageSpec.coffee9
-rw-r--r--js/vendor/momentjs/langs.js3190
-rw-r--r--templates/main.php4
-rw-r--r--templates/part.items.php2
11 files changed, 3236 insertions, 12 deletions
diff --git a/js/Gruntfile.coffee b/js/Gruntfile.coffee
index 503e16738..c12a5f322 100644
--- a/js/Gruntfile.coffee
+++ b/js/Gruntfile.coffee
@@ -67,7 +67,7 @@ module.exports = (grunt) ->
dest: ''
wrapper: [
'(function(angular, $, hex_md5, moment, undefined){\n\n'
- '\n})(window.angular, jQuery, hex_md5, moment);'
+ '\n})(window.angular, window.jQuery, window.hex_md5, window.moment);'
]
coffeelint:
diff --git a/js/app/controllers/itemcontroller.coffee b/js/app/controllers/itemcontroller.coffee
index 71bbb13be..52f1c271a 100644
--- a/js/app/controllers/itemcontroller.coffee
+++ b/js/app/controllers/itemcontroller.coffee
@@ -29,7 +29,6 @@ angular.module('News').controller 'ItemController',
constructor: (@_$scope, @_itemBl, @_feedModel, @_feedLoading,
@_feedBl, @_language) ->
-
@_$scope.itemBl = @_itemBl
@_$scope.feedBl = @_feedBl
@@ -43,7 +42,14 @@ angular.module('News').controller 'ItemController',
else
return ''
+ @_$scope.getRelativeDate = (date) =>
+ if date
+ return @_language.getMomentFromTimestamp(date).fromNow()
+ else
+ return ''
+
+
return new ItemController($scope, ItemBl, FeedModel, FeedLoading, FeedBl,
- Language)
+ Language)
] \ No newline at end of file
diff --git a/js/app/services/language.coffee b/js/app/services/language.coffee
index 85a405fc7..ac46b0bc4 100644
--- a/js/app/services/language.coffee
+++ b/js/app/services/language.coffee
@@ -27,11 +27,17 @@ angular.module('News').factory 'Language', ->
constructor: ->
@_language = 'en'
+
handle: (data) ->
- @_language = data.language
+ @_language = data.split('_')[0]
+
getLanguage: ->
return @_language
+ getMomentFromTimestamp: (timestamp) ->
+ return moment.unix(timestamp).lang(@_language)
+
+
return new Language()
diff --git a/js/app/services/moment.coffee b/js/app/services/moment.coffee
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/js/app/services/moment.coffee
diff --git a/js/app/services/services.coffee b/js/app/services/services.coffee
index 19e4b990d..d67e1d2c5 100644
--- a/js/app/services/services.coffee
+++ b/js/app/services/services.coffee
@@ -99,4 +99,3 @@ FolderModel, FeedModel, Language) ->
return publisher
]
-
diff --git a/js/config/testacular_conf.js b/js/config/testacular_conf.js
index 9cc769b13..17c654805 100644
--- a/js/config/testacular_conf.js
+++ b/js/config/testacular_conf.js
@@ -37,6 +37,7 @@ files = [
'vendor/angular/angular-mocks.js',
'vendor/angular-ui/angular-ui.js',
'vendor/md5js/md5.js',
+ 'vendor/momentjs/moment.js',
'../../appframework/js/tests/stubs/owncloud.js',
'../../appframework/js/public/app.js',
'tests/stubs/modules.js',
diff --git a/js/public/app.js b/js/public/app.js
index 0f4912af6..f9ae29d48 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -371,6 +371,13 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
return '';
}
};
+ this._$scope.getRelativeDate = function(date) {
+ if (date) {
+ return _this._language.getMomentFromTimestamp(date).fromNow();
+ } else {
+ return '';
+ }
+ };
}
return ItemController;
@@ -1401,13 +1408,17 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}
Language.prototype.handle = function(data) {
- return this._language = data.language;
+ return this._language = data.split('_')[0];
};
Language.prototype.getLanguage = function() {
return this._language;
};
+ Language.prototype.getMomentFromTimestamp = function(timestamp) {
+ return moment.unix(timestamp).lang(this._language);
+ };
+
return Language;
})();
@@ -1926,6 +1937,12 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
// Generated by CoffeeScript 1.6.2
+(function() {
+
+
+}).call(this);
+
+// Generated by CoffeeScript 1.6.2
/*
ownCloud - News
@@ -2784,4 +2801,4 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
}).call(this);
-})(window.angular, jQuery, hex_md5, moment); \ No newline at end of file
+})(window.angular, window.jQuery, window.hex_md5, window.moment); \ No newline at end of file
diff --git a/js/tests/services/languageSpec.coffee b/js/tests/services/languageSpec.coffee
index 526d4ecbc..958b91ad1 100644
--- a/js/tests/services/languageSpec.coffee
+++ b/js/tests/services/languageSpec.coffee
@@ -26,15 +26,18 @@ describe 'Language', ->
beforeEach module 'News'
beforeEach inject (@Language, @FeedType) =>
- @data =
- language: 'de'
+ @data = 'de'
it 'should be en by default', =>
expect(@Language.getLanguage()).toBe('en')
- it 'should set the correct feed id', =>
+ it 'should set the correct language', =>
@Language.handle(@data)
expect(@Language.getLanguage()).toBe('de')
+ it 'should only set the first part of the language', =>
+ @Language.handle 'de_DE'
+ expect(@Language.getLanguage()).toBe('de')
+
diff --git a/js/vendor/momentjs/langs.js b/js/vendor/momentjs/langs.js
new file mode 100644
index 000000000..0c4c4fc78
--- /dev/null
+++ b/js/vendor/momentjs/langs.js
@@ -0,0 +1,3190 @@
+(function(){
+ function onload (moment) {
+(function(){
+// moment.js language configuration
+// language : Moroccan Arabic (ar-ma)
+// author : ElFadili Yassine : https://github.com/ElFadiliY
+// author : Abdel Said : https://github.com/abdelsaid
+
+moment.lang('ar-ma', {
+ months : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),
+ monthsShort : "يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),
+ weekdays : "الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),
+ weekdaysShort : "احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),
+ weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"),
+ longDateFormat : {
+ LT : "HH:mm",
+ L : "DD/MM/YYYY",
+ LL : "D MMMM YYYY",
+ LLL : "D MMMM YYYY LT",
+ LLLL : "dddd D MMMM YYYY LT"
+ },
+ calendar : {
+ sameDay: "[اليوم على الساعة] LT",
+ nextDay: '[غدا على الساعة] LT',
+ nextWeek: 'dddd [على الساعة] LT',
+ lastDay: '[أمس على الساعة] LT',
+ lastWeek: 'dddd [على الساعة] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : "في %s",
+ past : "منذ %s",
+ s : "ثوان",
+ m : "دقيقة",
+ mm : "%d دقائق",
+ h : "ساعة",
+ hh : "%d ساعات",
+ d : "يوم",
+ dd : "%d أيام",
+ M : "شهر",
+ MM : "%d أشهر",
+ y : "سنة",
+ yy : "%d سنوات"
+ },
+ week : {
+ dow : 6, // Saturday is the first day of the week.
+ doy : 12 // The week that contains Jan 1st is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : Arabic (ar)
+// author : Abdel Said : https://github.com/abdelsaid
+
+moment.lang('ar', {
+ months : "كانون الثاني_ﺶﺑﺎﻃ_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_تشرين الثاني_كانون الأول".split("_"),
+ monthsShort : "كانون الثاني_ﺶﺑﺎﻃ_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_تشرين الثاني_كانون الأول".split("_"),
+ weekdays : "الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),
+ weekdaysShort : "احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),
+ weekdaysMin : "ح_ن_ث_ر_خ_ج_س".split("_"),
+ longDateFormat : {
+ LT : "HH:mm",
+ L : "DD/MM/YYYY",
+ LL : "D MMMM YYYY",
+ LLL : "D MMMM YYYY LT",
+ LLLL : "dddd D MMMM YYYY LT"
+ },
+ calendar : {
+ sameDay: "[اليوم على الساعة] LT",
+ nextDay: '[غدا على الساعة] LT',
+ nextWeek: 'dddd [على الساعة] LT',
+ lastDay: '[أمس على الساعة] LT',
+ lastWeek: 'dddd [على الساعة] LT',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : "في %s",
+ past : "منذ %s",
+ s : "ثوان",
+ m : "دقيقة",
+ mm : "%d دقائق",
+ h : "ساعة",
+ hh : "%d ساعات",
+ d : "يوم",
+ dd : "%d أيام",
+ M : "شهر",
+ MM : "%d أشهر",
+ y : "سنة",
+ yy : "%d سنوات"
+ },
+ week : {
+ dow : 6, // Saturday is the first day of the week.
+ doy : 12 // The week that contains Jan 1st is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : bulgarian (bg)
+// author : Krasen Borisov : https://github.com/kraz
+
+moment.lang('bg', {
+ months : "януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),
+ monthsShort : "янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),
+ weekdays : "неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),
+ weekdaysShort : "нед_пон_вто_сря_чет_пет_съб".split("_"),
+ weekdaysMin : "нд_пн_вт_ср_чт_пт_сб".split("_"),
+ longDateFormat : {
+ LT : "h:mm",
+ L : "D.MM.YYYY",
+ LL : "D MMMM YYYY",
+ LLL : "D MMMM YYYY LT",
+ LLLL : "dddd, D MMMM YYYY LT"
+ },
+ calendar : {
+ sameDay : '[Днес в] LT',
+ nextDay : '[Утре в] LT',
+ nextWeek : 'dddd [в] LT',
+ lastDay : '[Вчера в] LT',
+ lastWeek : function () {
+ switch (this.day()) {
+ case 0:
+ case 3:
+ case 6:
+ return '[В изминалата] dddd [в] LT';
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ return '[В изминалия] dddd [в] LT';
+ }
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : "след %s",
+ past : "преди %s",
+ s : "няколко секунди",
+ m : "минута",
+ mm : "%d минути",
+ h : "час",
+ hh : "%d часа",
+ d : "ден",
+ dd : "%d дни",
+ M : "месец",
+ MM : "%d месеца",
+ y : "година",
+ yy : "%d години"
+ },
+ ordinal : function (number) {
+ var lastDigit = number % 10,
+ last2Digits = number % 100;
+ if (number === 0) {
+ return number + '-ев';
+ } else if (last2Digits === 0) {
+ return number + '-ен';
+ } else if (last2Digits > 10 && last2Digits < 20) {
+ return number + '-ти';
+ } else if (lastDigit === 1) {
+ return number + '-ви';
+ } else if (lastDigit === 2) {
+ return number + '-ри';
+ } else if (lastDigit === 7 || lastDigit === 8) {
+ return number + '-ми';
+ } else {
+ return number + '-ти';
+ }
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : catalan (ca)
+// author : Juan G. Hurtado : https://github.com/juanghurtado
+
+moment.lang('ca', {
+ months : "Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),
+ monthsShort : "Gen._Febr._Mar._Abr._Mai._Jun._Jul._Ag._Set._Oct._Nov._Des.".split("_"),
+ weekdays : "Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),
+ weekdaysShort : "Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),
+ weekdaysMin : "Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),
+ longDateFormat : {
+ LT : "H:mm",
+ L : "DD/MM/YYYY",
+ LL : "D MMMM YYYY",
+ LLL : "D MMMM YYYY LT",
+ LLLL : "dddd D MMMM YYYY LT"
+ },
+ calendar : {
+ sameDay : function () {
+ return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ nextDay : function () {
+ return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ nextWeek : function () {
+ return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ lastDay : function () {
+ return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ lastWeek : function () {
+ return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
+ },
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : "en %s",
+ past : "fa %s",
+ s : "uns segons",
+ m : "un minut",
+ mm : "%d minuts",
+ h : "una hora",
+ hh : "%d hores",
+ d : "un dia",
+ dd : "%d dies",
+ M : "un mes",
+ MM : "%d mesos",
+ y : "un any",
+ yy : "%d anys"
+ },
+ ordinal : '%dº',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : czech (cs)
+// author : petrbela : https://github.com/petrbela
+
+var months = "leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),
+ monthsShort = "led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");
+
+function plural(n) {
+ return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
+}
+
+function translate(number, withoutSuffix, key, isFuture) {
+ var result = number + " ";
+ switch (key) {
+ case 's': // a few seconds / in a few seconds / a few seconds ago
+ return (withoutSuffix || isFuture) ? 'pár vteřin' : 'pár vteřinami';
+ case 'm': // a minute / in a minute / a minute ago
+ return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
+ case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'minuty' : 'minut');
+ } else {
+ return result + 'minutami';
+ }
+ break;
+ case 'h': // an hour / in an hour / an hour ago
+ return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
+ case 'hh': // 9 hours / in 9 hours / 9 hours ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'hodiny' : 'hodin');
+ } else {
+ return result + 'hodinami';
+ }
+ break;
+ case 'd': // a day / in a day / a day ago
+ return (withoutSuffix || isFuture) ? 'den' : 'dnem';
+ case 'dd': // 9 days / in 9 days / 9 days ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'dny' : 'dní');
+ } else {
+ return result + 'dny';
+ }
+ break;
+ case 'M': // a month / in a month / a month ago
+ return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
+ case 'MM': // 9 months / in 9 months / 9 months ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'měsíce' : 'měsíců');
+ } else {
+ return result + 'měsíci';
+ }
+ break;
+ case 'y': // a year / in a year / a year ago
+ return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
+ case 'yy': // 9 years / in 9 years / 9 years ago
+ if (withoutSuffix || isFuture) {
+ return result + (plural(number) ? 'roky' : 'let');
+ } else {
+ return result + 'lety';
+ }
+ break;
+ }
+}
+
+moment.lang('cs', {
+ months : months,
+ monthsShort : monthsShort,
+ monthsParse : (function (months, monthsShort) {
+ var i, _monthsParse = [];
+ for (i = 0; i < 12; i++) {
+ // use custom parser to solve problem with July (červenec)
+ _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
+ }
+ return _monthsParse;
+ }(months, monthsShort)),
+ weekdays : "neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),
+ weekdaysShort : "ne_po_út_st_čt_pá_so".split("_"),
+ weekdaysMin : "ne_po_út_st_čt_pá_so".split("_"),
+ longDateFormat : {
+ LT: "H:mm",
+ L : "DD.MM.YYYY",
+ LL : "D. MMMM YYYY",
+ LLL : "D. MMMM YYYY LT",
+ LLLL : "dddd D. MMMM YYYY LT"
+ },
+ calendar : {
+ sameDay: "[dnes v] LT",
+ nextDay: '[zítra v] LT',
+ nextWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[v neděli v] LT';
+ case 1:
+ case 2:
+ return '[v] dddd [v] LT';
+ case 3:
+ return '[ve středu v] LT';
+ case 4:
+ return '[ve čtvrtek v] LT';
+ case 5:
+ return '[v pátek v] LT';
+ case 6:
+ return '[v sobotu v] LT';
+ }
+ },
+ lastDay: '[včera v] LT',
+ lastWeek: function () {
+ switch (this.day()) {
+ case 0:
+ return '[minulou neděli v] LT';
+ case 1:
+ case 2:
+ return '[minulé] dddd [v] LT';
+ case 3:
+ return '[minulou středu v] LT';
+ case 4:
+ case 5:
+ return '[minulý] dddd [v] LT';
+ case 6:
+ return '[minulou sobotu v] LT';
+ }
+ },
+ sameElse: "L"
+ },
+ relativeTime : {
+ future : "za %s",
+ past : "před %s",
+ s : translate,
+ m : translate,
+ mm : translate,
+ h : translate,
+ hh : translate,
+ d : translate,
+ dd : translate,
+ M : translate,
+ MM : translate,
+ y : translate,
+ yy : translate
+ },
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : chuvash (cv)
+// author : Anatoly Mironov : https://github.com/mirontoli
+
+
+moment.lang('cv', {
+ months : "кăрлач_нарăс_пуш_ака_май_çĕртме_утă_çурла_авăн_юпа_чӳк_раштав".split("_"),
+ monthsShort : "кăр_нар_пуш_ака_май_çĕр_утă_çур_ав_юпа_чӳк_раш".split("_"),
+ weekdays : "вырсарникун_тунтикун_ытларикун_юнкун_кĕçнерникун_эрнекун_шăматкун".split("_"),
+ weekdaysShort : "выр_тун_ытл_юн_кĕç_эрн_шăм".split("_"),
+ weekdaysMin : "вр_тн_ыт_юн_кç_эр_шм".split("_"),
+ longDateFormat : {
+ LT : "HH:mm",
+ L : "DD-MM-YYYY",
+ LL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ]",
+ LLL : "YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT",
+ LLLL : "dddd, YYYY [çулхи] MMMM [уйăхĕн] D[-мĕшĕ], LT"
+ },
+ calendar : {
+ sameDay: '[Паян] LT [сехетре]',
+ nextDay: '[Ыран] LT [сехетре]',
+ lastDay: '[Ĕнер] LT [сехетре]',
+ nextWeek: '[Çитес] dddd LT [сехетре]',
+ lastWeek: '[Иртнĕ] dddd LT [сехетре]',
+ sameElse: 'L'
+ },
+ relativeTime : {
+ future : function (output) {
+ var affix = /сехет$/i.exec(output) ? "рен" : /çул$/i.exec(output) ? "тан" : "ран";
+ return output + affix;
+ },
+ past : "%s каялла",
+ s : "пĕр-ик çеккунт",
+ m : "пĕр минут",
+ mm : "%d минут",
+ h : "пĕр сехет",
+ hh : "%d сехет",
+ d : "пĕр кун",
+ dd : "%d кун",
+ M : "пĕр уйăх",
+ MM : "%d уйăх",
+ y : "пĕр çул",
+ yy : "%d çул"
+ },
+ ordinal : '%d-мĕш',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 7 // The week that contains Jan 1st is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : danish (da)
+// author : Ulrik Nielsen : https://github.com/mrbase
+
+moment.lang('da', {
+ months : "Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December".split("_"),
+ monthsShort : "Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec".split("_"),
+ weekdays : "Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag".split("_"),
+ weekdaysShort : "Søn_Man_Tir_Ons_Tor_Fre_Lør".split("_"),
+ weekdaysMin : "Sø_Ma_Ti_On_To_Fr_Lø".split("_"),
+ longDateFormat : {
+ LT : "HH:mm",
+ L : "DD/MM/YYYY",
+ LL : "D MMMM YYYY",
+ LLL : "D MMMM YYYY LT",
+ LLLL : "dddd D. MMMM, YYYY LT"
+ },
+ calendar : {
+ sameDay : '[I dag kl.] LT',
+ nextDay : '[I morgen kl.] LT',
+ nextWeek : 'dddd [kl.] LT',
+ lastDay : '[I går kl.] LT',
+ lastWeek : '[sidste] dddd [kl] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : "om %s",
+ past : "%s siden",
+ s : "få sekunder",
+ m : "et minut",
+ mm : "%d minutter",
+ h : "en time",
+ hh : "%d timer",
+ d : "en dag",
+ dd : "%d dage",
+ M : "en måned",
+ MM : "%d måneder",
+ y : "et år",
+ yy : "%d år"
+ },
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : german (de)
+// author : lluchs : https://github.com/lluchs
+
+moment.lang('de', {
+ months : "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),
+ monthsShort : "Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),
+ weekdays : "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),
+ weekdaysShort : "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),
+ weekdaysMin : "So_Mo_Di_Mi_Do_Fr_Sa".split("_"),
+ longDateFormat : {
+ LT: "H:mm U\\hr",
+ L : "DD.MM.YYYY",
+ LL : "D. MMMM YYYY",
+ LLL : "D. MMMM YYYY LT",
+ LLLL : "dddd, D. MMMM YYYY LT"
+ },
+ calendar : {
+ sameDay: "[Heute um] LT",
+ sameElse: "L",
+ nextDay: '[Morgen um] LT',
+ nextWeek: 'dddd [um] LT',
+ lastDay: '[Gestern um] LT',
+ lastWeek: '[letzten] dddd [um] LT'
+ },
+ relativeTime : {
+ future : "in %s",
+ past : "vor %s",
+ s : "ein paar Sekunden",
+ m : "einer Minute",
+ mm : "%d Minuten",
+ h : "einer Stunde",
+ hh : "%d Stunden",
+ d : "einem Tag",
+ dd : "%d Tagen",
+ M : "einem Monat",
+ MM : "%d Monaten",
+ y : "einem Jahr",
+ yy : "%d Jahren"
+ },
+ ordinal : '%d.',
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : modern greek (el)
+// author : Aggelos Karalias : https://github.com/mehiel
+
+moment.lang('el', {
+ monthsNominativeEl : "Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),
+ monthsGenitiveEl : "Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),
+ months : function (momentToFormat, format) {
+ if (/D/.test(format.substring(0, format.indexOf("MMMM")))) { // if there is a day number before 'MMMM'
+ return this._monthsGenitiveEl[momentToFormat.month()];
+ } else {
+ return this._monthsNominativeEl[momentToFormat.month()];
+ }
+ },
+ monthsShort : "Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),
+ weekdays : "Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),
+ weekdaysShort : "Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),
+ weekdaysMin : "Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),
+ meridiem : function (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'μμ' : 'ΜΜ';
+ } else {
+ return isLower ? 'πμ' : 'ΠΜ';
+ }
+ },
+ longDateFormat : {
+ LT : "h:mm A",
+ L : "DD/MM/YYYY",
+ LL : "D MMMM YYYY",
+ LLL : "D MMMM YYYY LT",
+ LLLL : "dddd, D MMMM YYYY LT"
+ },
+ calendarEl : {
+ sameDay : '[Σήμερα {}] LT',
+ nextDay : '[Αύριο {}] LT',
+ nextWeek : 'dddd [{}] LT',
+ lastDay : '[Χθες {}] LT',
+ lastWeek : '[την προηγούμενη] dddd [{}] LT',
+ sameElse : 'L'
+ },
+ calendar : function (key, mom) {
+ var output = this._calendarEl[key],
+ hours = mom && mom.hours();
+
+ return output.replace("{}", (hours % 12 === 1 ? "στη" : "στις"));
+ },
+ relativeTime : {
+ future : "σε %s",
+ past : "%s πριν",
+ s : "δευτερόλεπτα",
+ m : "ένα λεπτό",
+ mm : "%d λεπτά",
+ h : "μία ώρα",
+ hh : "%d ώρες",
+ d : "μία μέρα",
+ dd : "%d μέρες",
+ M : "ένας μήνας",
+ MM : "%d μήνες",
+ y : "ένας χρόνος",
+ yy : "%d χρόνια"
+ },
+ ordinal : function (number) {
+ return number + 'η';
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4st is the first week of the year.
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : canadian english (en-ca)
+// author : Jonathan Abourbih : https://github.com/jonbca
+
+moment.lang('en-ca', {
+ months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
+ monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
+ weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
+ weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
+ weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
+ longDateFormat : {
+ LT : "h:mm A",
+ L : "YYYY-MM-DD",
+ LL : "D MMMM, YYYY",
+ LLL : "D MMMM, YYYY LT",
+ LLLL : "dddd, D MMMM, YYYY LT"
+ },
+ calendar : {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : "in %s",
+ past : "%s ago",
+ s : "a few seconds",
+ m : "a minute",
+ mm : "%d minutes",
+ h : "an hour",
+ hh : "%d hours",
+ d : "a day",
+ dd : "%d days",
+ M : "a month",
+ MM : "%d months",
+ y : "a year",
+ yy : "%d years"
+ },
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (~~ (number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ }
+});
+})();
+(function(){
+// moment.js language configuration
+// language : great britain english (en-gb)
+// author : Chris Gedrim : https://github.com/chrisgedrim
+
+moment.lang('en-gb', {
+ months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
+ monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
+ weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
+ weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
+ weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
+ longDateFormat : {
+ LT : "h:mm A",
+ L : "DD/MM/YYYY",
+ LL : "D MMMM YYYY",
+ LLL : "D MMMM YYYY LT",
+ LLLL : "dddd, D MMMM YYYY LT"
+ },
+ calendar : {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ },
+ relativeTime : {
+ future : "in %s",
+ past : "%s ago",
+ s : "a few seconds",
+ m : "a minute",
+ mm : "%d minutes",
+ h : "an hour",
+ hh : "%d hours",
+ d : "a day",
+ dd : "%d days",
+ M : "a month",
+ MM : "%d months",
+ y : "a year",
+ yy : "%d years"
+ },
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (~~ (number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ },
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+});
+})();
+(function(){<