Context: Utilizing the SailsJS framework to showcase the timestamp of data model updates. The framework, originating from 'parasails', leverages Vue.js and offers the
<js-timestamp :at="1573487792252">
component to display elapsed time like "a few seconds ago" that dynamically updates over time. Meanwhile, real-time updates are pushed from the server to the browser via WebSocket, prompting the need to synchronize the <js-timestamp>
with the updated reference timestamp.
Issue: Upon initial page load, parasails replaces the <js-timestamp>
tag with a
<span parasails-component="js-timestamp">
, displaying the static "time since" message instead of the actual timestamp value. Efforts to manipulate this using JQuery have proven ineffective as the dynamic updating functionality is lost. Reviewing the source code of the js-timestamp
component reveals the use of moment(this.at).fromNow()
for generating the "time since" text within 24 hours, but manual replacement disrupts automatic updates.
Query: How can the timestamp be seamlessly updated to ensure continuous dynamic message updates by parasails or Vue.js?