@trops/dash-core 0.1.152 → 0.1.153

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -15851,18 +15851,20 @@ function formatCountdown(ms) {
15851
15851
  }
15852
15852
 
15853
15853
  /**
15854
- * Format a timestamp as relative time ago.
15854
+ * Format a timestamp as an absolute time string.
15855
15855
  * @param {number|string} timestamp - epoch ms or ISO string
15856
- * @returns {string} e.g. "2m ago", "1h ago", "just now"
15856
+ * @returns {string} e.g. "1:05:30 PM" for today, or full date+time for older
15857
15857
  */
15858
15858
  function formatRelativeTime(timestamp) {
15859
15859
  if (!timestamp) return null;
15860
15860
  var ts = typeof timestamp === "string" ? new Date(timestamp).getTime() : timestamp;
15861
- var diff = Date.now() - ts;
15862
- if (diff < 60000) return "just now";
15863
- if (diff < 3600000) return "".concat(Math.floor(diff / 60000), "m ago");
15864
- if (diff < 86400000) return "".concat(Math.floor(diff / 3600000), "h ago");
15865
- return "".concat(Math.floor(diff / 86400000), "d ago");
15861
+ var date = new Date(ts);
15862
+ var now = new Date();
15863
+ var isToday = date.getFullYear() === now.getFullYear() && date.getMonth() === now.getMonth() && date.getDate() === now.getDate();
15864
+ if (isToday) {
15865
+ return date.toLocaleTimeString();
15866
+ }
15867
+ return date.toLocaleString();
15866
15868
  }
15867
15869
 
15868
15870
  /**