You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a detail in the add-on code that causes it to return the date in milliseconds when a comment is edited and then generates problems when formatting the editing date with moment.
The request I found is to replace the date in milliseconds with the ISO format that gives the current date and time in UTC:
modified: new Date().toISOString()
You have to update this:
var commentJSON = $.extend({}, this.commentsById[textarea.attr('data-comment')]); $.extend(commentJSON, { parent: textarea.attr('data-parent') || null, content: this.getTextareaContent(textarea), pings: this.getPings(textarea), modified: new Date().toISOString() //This is the update code });
Then it is possible to format the date without problems in the following way:
timeFormatter: function (time) { moment.locale('es'); return moment.utc(time, 'YYYY-MM-DD HH:mm:ss').local().fromNow(); }
The text was updated successfully, but these errors were encountered:
There is a detail in the add-on code that causes it to return the date in milliseconds when a comment is edited and then generates problems when formatting the editing date with moment.
The request I found is to replace the date in milliseconds with the ISO format that gives the current date and time in UTC:
modified: new Date().toISOString()
You have to update this:
var commentJSON = $.extend({}, this.commentsById[textarea.attr('data-comment')]); $.extend(commentJSON, { parent: textarea.attr('data-parent') || null, content: this.getTextareaContent(textarea), pings: this.getPings(textarea), modified: new Date().toISOString() //This is the update code });
Then it is possible to format the date without problems in the following way:
timeFormatter: function (time) { moment.locale('es'); return moment.utc(time, 'YYYY-MM-DD HH:mm:ss').local().fromNow(); }
The text was updated successfully, but these errors were encountered: