chore: fix issue with custom note title format

This commit is contained in:
Aman Harwara
2023-07-28 12:36:17 +05:30
parent c3cd88c509
commit fee9dcaa34
4 changed files with 35 additions and 15 deletions

View File

@@ -0,0 +1,18 @@
import dayjs from 'dayjs'
import AdvancedFormat from 'dayjs/plugin/advancedFormat'
import IsoWeek from 'dayjs/plugin/isoWeek'
import UTC from 'dayjs/plugin/utc'
import Timezone from 'dayjs/plugin/timezone'
import WeekYear from 'dayjs/plugin/weekYear'
import WeekOfYear from 'dayjs/plugin/weekOfYear'
dayjs.extend(AdvancedFormat)
dayjs.extend(IsoWeek)
dayjs.extend(UTC)
dayjs.extend(Timezone)
dayjs.extend(WeekYear)
dayjs.extend(WeekOfYear)
export function getDayjsFormattedString(date: Parameters<typeof dayjs>[0], format: string): string {
return dayjs(date).format(format)
}