@tangle-network/ui 11.51.17 → 11.51.18

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 11.51.18
2
+
3
+ ### Patch Changes
4
+
5
+ - df719a3: `timeAgo` counts days past 24 hours (`3d ago`) instead of hours.
6
+
1
7
  ## 11.51.17
2
8
 
3
9
  ### Patch Changes
@@ -5,6 +5,7 @@ function timeAgo(ts) {
5
5
  if (secs < 60) return `${secs}s ago`;
6
6
  const mins = Math.floor(secs / 60);
7
7
  if (mins < 60) return `${mins}m ago`;
8
- return `${Math.floor(mins / 60)}h ago`;
8
+ const hrs = Math.floor(mins / 60);
9
+ return hrs < 24 ? `${hrs}h ago` : `${Math.floor(hrs / 24)}d ago`;
9
10
  }
10
11
  export { timeAgo };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/ui",
3
- "version": "11.51.17",
3
+ "version": "11.51.18",
4
4
  "description": "Generic React UI components for Tangle products — primitives, chat, run, files, editor, markdown.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -216,7 +216,7 @@
216
216
  "peerDependencies": {
217
217
  "@hocuspocus/provider": ">=2.15.0 <5.0.0",
218
218
  "@nanostores/react": ">=0.8.4 <3.0.0",
219
- "@tangle-network/brand": "^1.31.3",
219
+ "@tangle-network/brand": "^1.31.4",
220
220
  "@tiptap/core": ">=3.20.4 <4.0.0",
221
221
  "@tiptap/extension-collaboration": ">=3.20.4 <4.0.0",
222
222
  "@tiptap/extension-collaboration-caret": ">=3.7.0 <4.0.0",
@@ -5,5 +5,5 @@ export function timeAgo(ts: number): string {
5
5
  const mins = Math.floor(secs / 60);
6
6
  if (mins < 60) return `${mins}m ago`;
7
7
  const hrs = Math.floor(mins / 60);
8
- return `${hrs}h ago`;
8
+ return hrs < 24 ? `${hrs}h ago` : `${Math.floor(hrs / 24)}d ago`;
9
9
  }