Files
klz-cables.com/.pnpm-store/v10/files/62/bf66f46a81b02eab064057b026178ba6cdd29db0a710a3f552e9b26c6883f76ddc95354ac88bfc304588602bb351fd3b7800444b9f9c8dc068ba25b7937091
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

76 lines
2.0 KiB
Plaintext

import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { MySqlColumn, MySqlColumnBuilder } from "./common.js";
class MySqlDateTimeBuilder extends MySqlColumnBuilder {
static [entityKind] = "MySqlDateTimeBuilder";
constructor(name, config) {
super(name, "date", "MySqlDateTime");
this.config.fsp = config?.fsp;
}
/** @internal */
build(table) {
return new MySqlDateTime(
table,
this.config
);
}
}
class MySqlDateTime extends MySqlColumn {
static [entityKind] = "MySqlDateTime";
fsp;
constructor(table, config) {
super(table, config);
this.fsp = config.fsp;
}
getSQLType() {
const precision = this.fsp === void 0 ? "" : `(${this.fsp})`;
return `datetime${precision}`;
}
mapToDriverValue(value) {
return value.toISOString().replace("T", " ").replace("Z", "");
}
mapFromDriverValue(value) {
return /* @__PURE__ */ new Date(value.replace(" ", "T") + "Z");
}
}
class MySqlDateTimeStringBuilder extends MySqlColumnBuilder {
static [entityKind] = "MySqlDateTimeStringBuilder";
constructor(name, config) {
super(name, "string", "MySqlDateTimeString");
this.config.fsp = config?.fsp;
}
/** @internal */
build(table) {
return new MySqlDateTimeString(
table,
this.config
);
}
}
class MySqlDateTimeString extends MySqlColumn {
static [entityKind] = "MySqlDateTimeString";
fsp;
constructor(table, config) {
super(table, config);
this.fsp = config.fsp;
}
getSQLType() {
const precision = this.fsp === void 0 ? "" : `(${this.fsp})`;
return `datetime${precision}`;
}
}
function datetime(a, b) {
const { name, config } = getColumnNameAndConfig(a, b);
if (config?.mode === "string") {
return new MySqlDateTimeStringBuilder(name, config);
}
return new MySqlDateTimeBuilder(name, config);
}
export {
MySqlDateTime,
MySqlDateTimeBuilder,
MySqlDateTimeString,
MySqlDateTimeStringBuilder,
datetime
};
//# sourceMappingURL=datetime.js.map