From 18302609108056e09d87e2e6aeaa756aac0620e8 Mon Sep 17 00:00:00 2001 From: arturka Date: Mon, 21 Apr 2025 17:27:39 +0200 Subject: [PATCH] fix: dayjs utc plugin import --- src/lib/utils.ts | 20 ++++++++++---------- src/server/utils.ts | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index a6f9644..d36d978 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,13 +1,13 @@ -import dayjs from "dayjs" -import utc from "dayjs/plugin/utc" -import { type ClassValue, clsx } from "clsx" -import { twMerge } from "tailwind-merge" -import type { TaskSelect } from "~/server/db/schema" +import dayjs from 'dayjs' +import utc from 'dayjs/plugin/utc.js' +import { type ClassValue, clsx } from 'clsx' +import { twMerge } from 'tailwind-merge' +import type { TaskSelect } from '~/server/db/schema' dayjs.extend(utc) export function formatDate(date: string) { - return dayjs.utc(date).local().format("MMM D, YYYY hh:mm A") + return dayjs.utc(date).local().format('MMM D, YYYY hh:mm A') } export function cn(...inputs: ClassValue[]) { @@ -16,7 +16,7 @@ export function cn(...inputs: ClassValue[]) { export function limitText(text: string, length: number) { if (text.length > length) { - return text.slice(0, length).trim() + "..." + return text.slice(0, length).trim() + '...' } return text } @@ -25,14 +25,14 @@ export function formatReturnValue(task: TaskSelect) { if (task.returnValue?.return_value) { return task.returnValue.return_value } else { - return "null" + return 'null' } } // temporarily, while dishka hasn't fixed it's module naming bug export function formatTaskName(taskName: string) { - if (taskName.includes(":")) { - const parts = taskName.split(":") + if (taskName.includes(':')) { + const parts = taskName.split(':') return parts[parts.length - 1] } else { return taskName diff --git a/src/server/utils.ts b/src/server/utils.ts index 8f843ee..6ff6b6b 100644 --- a/src/server/utils.ts +++ b/src/server/utils.ts @@ -1,5 +1,5 @@ import dayjs from 'dayjs' -import utc from 'dayjs/plugin/utc' +import utc from 'dayjs/plugin/utc.js' import { NotFoundError } from './exceptions' dayjs.extend(utc)