@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/CHANGELOG.md +6 -0
- package/dist/core/index.cjs +4 -8
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +2 -6
- package/dist/core/index.js.map +1 -1
- package/dist/index.cjs +2 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +2 -6
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +2 -6
- package/dist/react/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -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
|
-
|
|
362
|
-
const h = Math.floor(whole / 3600);
|
|
363
|
-
const m = Math.floor(whole % 3600 / 60);
|
|
364
|
-
const s = whole % 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(text) {
|
|
369
365
|
const t = text.trim().toLowerCase();
|