v1.18.x
barisusakli 8 years ago
parent 1a9dd2311c
commit a9984bb926

@ -150,6 +150,7 @@ if ('undefined' !== typeof window) {
overrides.overrideTimeago = function () {
var timeagoFn = $.fn.timeago;
$.timeago.settings.cutoff = 1000 * 60 * 60 * 24 * 30;
$.fn.timeago = function () {
var els = timeagoFn.apply(this, arguments);

@ -194,7 +194,41 @@
$(this).text(inWords(data.datetime));
} else {
if ($(this).attr('title').length > 0) {
$(this).text($(this).attr('title'));
//$(this).text($(this).attr('title'));
var languageCode = void 0;
switch (config.userLang) {
case 'en_GB':
case 'en_US':
languageCode = 'en';
break;
case 'fa_IR':
languageCode = 'fa';
break;
case 'pt_BR':
languageCode = 'pt-br';
break;
case 'nb':
languageCode = 'no';
break;
case 'zh_TW':
languageCode = 'zh-TW';
break;
case 'zh_CN':
languageCode = 'zh-CN';
break;
default:
languageCode = config.userLang;
break;
}
var options = { year: 'numeric', month: 'long', day: 'numeric' };
$(this).text(new Date($(this).attr('title')).toLocaleString(languageCode, options));
}
}
}

Loading…
Cancel
Save