Extended DayJS plugins don't all work

Hello,

It seems that we can’t use all plugins from extendedDayjs

import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone";
import localeData from "dayjs/plugin/localeData";
import localizedFormat from "dayjs/plugin/localizedFormat";
import customParseFormat from "dayjs/plugin/customParseFormat";

const extendedDayjs = dayjs;
extendedDayjs.extend(timezone);
extendedDayjs.extend(utc);
extendedDayjs.extend(localeData);
extendedDayjs.extend(localizedFormat);
extendedDayjs.extend(customParseFormat);

export { extendedDayjs };
import { extendedDayjs } from "@com.mgmtp.a12.widgets/widgets-core/lib/common";

const formatChangelogDate = (language: "en" | "de", date?: Date): string => {
	if (!date) {
		return "";
	}

	const dateFormat = language === "en" ? "MM/DD/YYYY [at] hh:mm:ss a" : "DD.MM.YYYY [um] HH:mm:ss";
	const parsedDate = extendedDayjs(date);
	const timezone = extendedDayjs.tz?.guess();
	const tzDate = parsedDate.tz(timezone);
	return tzDate.format(dateFormat);
};

Here I can use the function tz that comes from the plugin timezone but I can’t use any function from other plugins, such as utc:

Would you have any idea on the reason why?

Hi @alexis-raw-iron , this is a known issue with dayjs. You need to configure dayjs yourself and not use the extendedDayjs from Widgets

Thank you, I didn’t know about that.