@ai-matrx/records 0.78.0 → 0.78.1

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.
@@ -314,6 +314,7 @@ function previewRuleChange(rules, groups, partial = false) {
314
314
  }
315
315
 
316
316
  // src/newerKinds.ts
317
+ import { formatDurationSeconds } from "@ai-matrx/kit/format";
317
318
  var NEWER_FIELD_KINDS = [
318
319
  "rating",
319
320
  "duration",
@@ -358,12 +359,7 @@ function ratingMaxOf(field) {
358
359
  function durationText(seconds) {
359
360
  const n = typeof seconds === "number" ? seconds : typeof seconds === "string" && seconds.trim() !== "" ? Number(seconds) : NaN;
360
361
  if (!Number.isFinite(n)) return null;
361
- const whole2 = Math.round(Math.abs(n));
362
- const h = Math.floor(whole2 / 3600);
363
- const m = Math.floor(whole2 % 3600 / 60);
364
- const s = whole2 % 60;
365
- const sign = n < 0 ? "-" : "";
366
- return s === 0 ? `${sign}${h}:${String(m).padStart(2, "0")}` : `${sign}${h}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
362
+ return formatDurationSeconds(Math.round(n), { granularity: "minute", signed: true });
367
363
  }
368
364
  function readTypedDuration(text2) {
369
365
  const t = text2.trim().toLowerCase();