socket-function 0.29.0 → 0.30.0

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": "socket-function",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -247,6 +247,17 @@ export function formatNiceDateTime(time: number) {
247
247
  return date.getFullYear() + " " + date.toLocaleString("default", { month: "long" }) + " " + date.getDate() + ", " + days[date.getDay()] + ", " + strTime;
248
248
  }
249
249
 
250
+ /** 2024 January 1, Monday, 12:53:02pm (4 months ago) */
251
+ export function formatVeryNiceDateTime(time: number) {
252
+ if (!time) {
253
+ return "";
254
+ }
255
+ if (typeof time !== "number") {
256
+ return String(time);
257
+ }
258
+ return `${formatNiceDateTime(time)} (${formatTime(Date.now() - time)})`;
259
+ }
260
+
250
261
  /** YYYY/MM/DD */
251
262
  export function formatDate(time: number) {
252
263
  function p(s: number) {