Skip to content

Commit 381e7c7

Browse files
authored
Merge pull request #5 from taskiq-python/fix/dayjs-utc-import
fix: dayjs utc plugin import
2 parents 6ccbe5f + 1830260 commit 381e7c7

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/lib/utils.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import dayjs from "dayjs"
2-
import utc from "dayjs/plugin/utc"
3-
import { type ClassValue, clsx } from "clsx"
4-
import { twMerge } from "tailwind-merge"
5-
import type { TaskSelect } from "~/server/db/schema"
1+
import dayjs from 'dayjs'
2+
import utc from 'dayjs/plugin/utc.js'
3+
import { type ClassValue, clsx } from 'clsx'
4+
import { twMerge } from 'tailwind-merge'
5+
import type { TaskSelect } from '~/server/db/schema'
66

77
dayjs.extend(utc)
88

99
export function formatDate(date: string) {
10-
return dayjs.utc(date).local().format("MMM D, YYYY hh:mm A")
10+
return dayjs.utc(date).local().format('MMM D, YYYY hh:mm A')
1111
}
1212

1313
export function cn(...inputs: ClassValue[]) {
@@ -16,7 +16,7 @@ export function cn(...inputs: ClassValue[]) {
1616

1717
export function limitText(text: string, length: number) {
1818
if (text.length > length) {
19-
return text.slice(0, length).trim() + "..."
19+
return text.slice(0, length).trim() + '...'
2020
}
2121
return text
2222
}
@@ -25,14 +25,14 @@ export function formatReturnValue(task: TaskSelect) {
2525
if (task.returnValue?.return_value) {
2626
return task.returnValue.return_value
2727
} else {
28-
return "null"
28+
return 'null'
2929
}
3030
}
3131

3232
// temporarily, while dishka hasn't fixed it's module naming bug
3333
export function formatTaskName(taskName: string) {
34-
if (taskName.includes(":")) {
35-
const parts = taskName.split(":")
34+
if (taskName.includes(':')) {
35+
const parts = taskName.split(':')
3636
return parts[parts.length - 1]
3737
} else {
3838
return taskName

src/server/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import dayjs from 'dayjs'
2-
import utc from 'dayjs/plugin/utc'
2+
import utc from 'dayjs/plugin/utc.js'
33
import { NotFoundError } from './exceptions'
44

55
dayjs.extend(utc)

0 commit comments

Comments
 (0)