Skip to content

Commit

Permalink
Exact dates for forwards
Browse files Browse the repository at this point in the history
  • Loading branch information
zhukov committed Jun 5, 2018
1 parent 32f67b1 commit c5fc510
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ angular.module('myApp.filters', ['myApp.i18n'])
}
})

.filter('dateMedium', function ($filter) {
var dateFilter = $filter('date')
return function (timestamp, extended) {
var ticks = timestamp * 1000
return dateFilter(ticks, 'medium')
}
})

.filter('time', function ($filter) {
var cachedDates = {}
var dateFilter = $filter('date')
Expand Down
2 changes: 1 addition & 1 deletion app/partials/desktop/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<span class="copyonly"><span my-i18n="message_forwarded_message"></span>:&nbsp;</span>
<a class="im_message_fwd_photo pull-left" my-peer-photolink="::historyMessage.fwdFromID" img-class="im_message_fwd_photo"></a>
<div class="im_message_fwd_author_wrap">
<a class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID" post-id="historyMessage.fwdPostID"></a><a ng-if="::historyMessage.viaBotID" class="im_message_fwd_via" ng-click="selectInlineBot(historyMessage.viaBotID, $event)"><span class="copyonly">&nbsp;</span><span my-i18n="message_via_bot"><my-i18n-param name="bot"><span class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></span></my-i18n-param></span></a><span class="copyonly">&nbsp;[</span><span class="im_message_fwd_date" ng-bind="::historyMessage.fwd_from.date | dateOrTime"></span><span class="copyonly">]&nbsp;</span>
<a class="im_message_fwd_author" my-peer-link="historyMessage.fwdFromID" post-id="historyMessage.fwdPostID"></a><a ng-if="::historyMessage.viaBotID" class="im_message_fwd_via" ng-click="selectInlineBot(historyMessage.viaBotID, $event)"><span class="copyonly">&nbsp;</span><span my-i18n="message_via_bot"><my-i18n-param name="bot"><span class="im_message_fwd_author" my-peer-link="historyMessage.viaBotID" username="true" no-watch="true"></span></my-i18n-param></span></a><span class="copyonly">&nbsp;[</span><span class="im_message_fwd_date" ng-bind="::historyMessage.fwd_from.date | dateMedium"></span><span class="copyonly">]&nbsp;</span>
<span class="im_message_views_inline" ng-if="::historyMessage.views > 0">
<i class="icon-message-views"></i><span class="im_message_views_cnt" my-message-views="historyMessage.mid"></span>
</span>
Expand Down

0 comments on commit c5fc510

Please sign in to comment.