From 59f6f40ace807b31e1eaa7cb2c43cf2c5b9d18b2 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 16 Sep 2024 19:24:39 +1200 Subject: [PATCH] Add seconds to display options --- client/homebrew/editor/snippetbar/snippetbar.jsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index fbab67d2f..615c707bf 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -162,13 +162,14 @@ const Snippetbar = createClass({ const saveTime = new Date(item.savedAt); const diffMs = new Date() - saveTime; - const diffMins = Math.floor(diffMs / (60 * 1000)); + const diffSecs = Math.floor(diffMs / 1000); - let diffString = `about ${diffMins} minutes ago`; + let diffString = `about ${diffSecs} seconds ago`; - if(diffMins > 60) diffString = `about ${Math.floor(diffMins / 60)} hours ago`; - if(diffMins > (24 * 60)) diffString = `about ${Math.floor(diffMins / (24 * 60))} days ago`; - if(diffMins > (7 * 24 * 60)) diffString = `about ${Math.floor(diffMins / (7 * 24 * 60))} weeks ago`; + if(diffSecs > 60) diffString = `about ${Math.floor(diffSecs / 60)} minutes ago`; + if(diffSecs > (60 * 60)) diffString = `about ${Math.floor(diffSecs / (60 * 60))} hours ago`; + if(diffSecs > (24 * 60 * 60)) diffString = `about ${Math.floor(diffSecs / (24 * 60 * 60))} days ago`; + if(diffSecs > (7 * 24 * 60 * 60)) diffString = `about ${Math.floor(diffSecs / (7 * 24 * 60 * 60))} weeks ago`; return
{this.replaceContent(item);}} >