Files
klz-cables.com/.pnpm-store/v10/files/a8/bf19da154c7696b15b8bd1478e6e05c882a7a593d897d3e86e68a5aadb6fe86c15afdb1ede747a8d35d34455268819c281c4dd10b1916d4e489dc155c496f2
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

35 lines
976 B
Plaintext

"use strict";
exports.formatRelative = void 0;
var _index = require("../../../isSameWeek.cjs");
function checkWeek(date, baseDate, options) {
const baseFormat = "eeee p";
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return baseFormat; // in same week
} else if (date.getTime() > baseDate.getTime()) {
return "'下个'" + baseFormat; // in next week
}
return "'上个'" + baseFormat; // in last week
}
const formatRelativeLocale = {
lastWeek: checkWeek, // days before yesterday, maybe in this week or last week
yesterday: "'昨天' p",
today: "'今天' p",
tomorrow: "'明天' p",
nextWeek: checkWeek, // days after tomorrow, maybe in this week or next week
other: "PP p",
};
const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};
exports.formatRelative = formatRelative;