mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°3649 - Activity panel: Fix wrong elapsed time displayed under entries after a new entry has been added
This commit is contained in:
@@ -382,14 +382,13 @@ $(function()
|
||||
const me = this;
|
||||
|
||||
this.element.find(this.js_selectors.entry_datetime).each(function(){
|
||||
const oEntryDateTime = moment($(this).text(), me.options.datetime_format);
|
||||
const oEntryDateTime = moment($(this).attr('data-formatted-datetime'), me.options.datetime_format);
|
||||
const oNowDateTime = moment();
|
||||
|
||||
// Reformat date time only if it is not too far in the past (eg. "2 years ago" is not easy to interpret)
|
||||
const fDays = moment.duration(oNowDateTime.diff(oEntryDateTime)).asDays();
|
||||
if(fDays < me.options.datetimes_reformat_limit)
|
||||
{
|
||||
$(this).text( moment($(this).text(), me.options.datetime_format).fromNow() );
|
||||
if (fDays < me.options.datetimes_reformat_limit) {
|
||||
$(this).text(moment($(this).attr('data-formatted-datetime'), me.options.datetime_format).fromNow());
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -32,8 +32,11 @@
|
||||
</div>
|
||||
<div class="ibo-activity-entry--sub-information" data-role="ibo-activity-entry--sub-information">
|
||||
{% block iboActivityEntrySubInformation %}
|
||||
<span class="ibo-activity-entry--datetime" data-role="ibo-activity-entry--datetime" data-tooltip-content="{{ oUIBlock.GetFormattedDateTime() }}">{{ oUIBlock.GetFormattedDateTime() }}</span>
|
||||
{% endblock %}
|
||||
<span class="ibo-activity-entry--datetime" data-role="ibo-activity-entry--datetime"
|
||||
data-tooltip-content="{{ oUIBlock.GetFormattedDateTime() }}"
|
||||
data-raw-datetime="{{ oUIBlock.GetRawDateTime() }}"
|
||||
data-formatted-datetime="{{ oUIBlock.GetFormattedDateTime() }}">{{ oUIBlock.GetFormattedDateTime() }}</span>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user