Added Backend

This commit is contained in:
2026-01-06 12:07:43 +01:00
parent b013ef8f4b
commit 6f3d4c0bff
165 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import fp from "fastify-plugin"
import dayjs from "dayjs"
// 🧩 Plugins
import customParseFormat from "dayjs/plugin/customParseFormat.js";
import isBetween from "dayjs/plugin/isBetween.js";
import duration from "dayjs/plugin/duration.js";
import utc from "dayjs/plugin/utc"
import timezone from "dayjs/plugin/timezone"
import isSameOrAfter from "dayjs/plugin/isSameOrAfter"
import isSameOrBefore from "dayjs/plugin/isSameOrBefore"
import isoWeek from "dayjs/plugin/isoWeek"
import localizedFormat from "dayjs/plugin/localizedFormat"
// 🔧 Erweiterungen aktivieren
dayjs.extend(utc)
dayjs.extend(timezone)
dayjs.extend(isSameOrAfter)
dayjs.extend(isSameOrBefore)
dayjs.extend(isBetween)
dayjs.extend(isoWeek)
dayjs.extend(localizedFormat)
dayjs.extend(customParseFormat)
dayjs.extend(isBetween)
dayjs.extend(duration)
/**
* Fastify Plugin: hängt dayjs an den Server an
*/
export default fp(async (server) => {
server.decorate("dayjs", dayjs)
})
/**
* Typ-Erweiterung für TypeScript
*/
declare module "fastify" {
interface FastifyInstance {
dayjs: typeof dayjs
}
}