@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.
package/dist/index.cjs CHANGED
@@ -545,6 +545,7 @@ function previewRuleChange(rules, groups, partial = false) {
545
545
  }
546
546
 
547
547
  // src/newerKinds.ts
548
+ var import_format = require("@ai-matrx/kit/format");
548
549
  var NEWER_FIELD_KINDS = [
549
550
  "rating",
550
551
  "duration",
@@ -589,12 +590,7 @@ function ratingMaxOf(field) {
589
590
  function durationText(seconds) {
590
591
  const n = typeof seconds === "number" ? seconds : typeof seconds === "string" && seconds.trim() !== "" ? Number(seconds) : NaN;
591
592
  if (!Number.isFinite(n)) return null;
592
- const whole = Math.round(Math.abs(n));
593
- const h = Math.floor(whole / 3600);
594
- const m = Math.floor(whole % 3600 / 60);
595
- const s = whole % 60;
596
- const sign = n < 0 ? "-" : "";
597
- return s === 0 ? `${sign}${h}:${String(m).padStart(2, "0")}` : `${sign}${h}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
593
+ return (0, import_format.formatDurationSeconds)(Math.round(n), { granularity: "minute", signed: true });
598
594
  }
599
595
  function readTypedDuration(text) {
600
596
  const t = text.trim().toLowerCase();