itemTimeDisplay (last visited time)

Description

Define a Handlebars template used to display last visited time in front of recently clicked search results.

To prevent the page reloading please ensure that "href=#" is used in the handlebar template.

Values passed to the template are:

  • icon - contents of time icon

  • timeAgo - the time difference between the timestamp when the element was clicked and current timestamp. This will be converted to human-readable sentences, such as "23 hours ago", "50 seconds ago" etc.

Widget contains predefined Handlebars partial templates that can be used:

  • {{icon}} - display {{icon}} from data model passed to template

  • timeAgo - display {{timeAgo}} from data model passed to template == Default value

itemTimeDisplay: {
  template: '<small class="text-warning session-history-link"><span class="{{icon}}"></span> <a title="Click history" href="#" class="text-warning session-history-show">Last visited {{timeAgo}}</a></small>',
}

Examples

itemTimeDisplay: {
    template: '<small class="text-info"><span class="{{icon}}"></span> <a title="Click history" href="#" class="text-warning session-history-show">Item viewed {{timeAgo}}</a></small>'
},