Rafał Pitoń 11 лет назад
Родитель
Сommit
f80ce3e0d1
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      misago/static/misago/admin/js/misago-timestamps.js

+ 4 - 1
misago/static/misago/admin/js/misago-timestamps.js

@@ -1,6 +1,7 @@
 $(function() {
   moment.lang($('html').attr('lang'))
   var moment_now = moment();
+  var time_format = moment_now.lang()._longDateFormat.LT;
 
   var moments = {};
 
@@ -24,8 +25,10 @@ $(function() {
       if (moments[timestamp] != undefined) {
         if (moment_now.diff(moments[timestamp].rel_moment, 'hours') <= 6) {
           $(this).text(moments[timestamp].rel_moment.fromNow());
-        } else if (moment_now.diff(moments[timestamp].rel_moment, 'days') <= 7) {
+        } else if (moment_now.diff(moments[timestamp].rel_moment, 'days') < 2) {
           $(this).text(moments[timestamp].rel_moment.calendar());
+        } else if (moment_now.diff(moments[timestamp].rel_moment, 'days') <= 7) {
+          $(this).text(moments[timestamp].rel_moment.format("dddd, " + time_format));
         } else {
           $(this).text(moments[timestamp].original);
         }