time-ago-dk 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "time-ago-dk",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A tiny JavaScript utility to convert dates into human readable 'time ago' format.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1,5 +1,9 @@
1
1
  import { timeAgo } from "../src/index.js";
2
2
 
3
+ // Test cases
4
+ console.log(timeAgo(new Date(Date.now() - 31536000000))); // 1 year ago
5
+ console.log(timeAgo(new Date(Date.now() - 2592000000))); // 1 month ago
6
+ console.log(timeAgo(new Date(Date.now() - 86400000))); // 1 day ago
3
7
  console.log(timeAgo(new Date(Date.now() - 60000))); // 1 minute ago
4
8
  console.log(timeAgo(new Date(Date.now() - 3600000))); // 1 hour ago
5
9
  console.log(timeAgo(new Date(Date.now() - 1000))); // just now