Day.js requires the 'utc' plugin to be loaded before the 'timezone' plugin to correctly apply timezone offsets during formatting. This fixes an issue where the Bookings Dashboard displayed UTC time but labeled it with the user's timezone. Fixes #28193 Co-authored-by: Harshith Kumar <mharshithkumar6@gmail.com> Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com>
32 lines
1017 B
TypeScript
32 lines
1017 B
TypeScript
/* eslint-disable @calcom/eslint/deprecated-imports */
|
|
import dayjs from "dayjs";
|
|
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
import duration from "dayjs/plugin/duration";
|
|
import isBetween from "dayjs/plugin/isBetween";
|
|
import isToday from "dayjs/plugin/isToday";
|
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
import minmax from "dayjs/plugin/minMax";
|
|
import relativeTime from "dayjs/plugin/relativeTime";
|
|
import timeZone from "dayjs/plugin/timezone";
|
|
import toArray from "dayjs/plugin/toArray";
|
|
import utc from "dayjs/plugin/utc";
|
|
import BusinessDaysPlugin from "./plugins/business-days-plugin";
|
|
|
|
dayjs.extend(customParseFormat);
|
|
dayjs.extend(BusinessDaysPlugin);
|
|
dayjs.extend(isBetween);
|
|
dayjs.extend(isToday);
|
|
dayjs.extend(localizedFormat);
|
|
dayjs.extend(relativeTime);
|
|
dayjs.extend(utc);
|
|
dayjs.extend(timeZone);
|
|
dayjs.extend(toArray);
|
|
dayjs.extend(minmax);
|
|
dayjs.extend(duration);
|
|
|
|
export type Dayjs = dayjs.Dayjs;
|
|
|
|
export type { ConfigType } from "dayjs";
|
|
|
|
export default dayjs;
|