@wener/console
Version:
Base console UI toolkit
39 lines (38 loc) • 1.31 kB
JavaScript
"use client";
import React from "react";
import { Toaster } from "react-hot-toast";
import { dayjs } from "@wener/common/dayjs";
import advancedFormat from "dayjs/plugin/advancedFormat";
import dayOfYear from "dayjs/plugin/dayOfYear";
import duration from "dayjs/plugin/duration";
import isToday from "dayjs/plugin/isToday";
import relativeTime from "dayjs/plugin/relativeTime";
import timezone from "dayjs/plugin/timezone";
import utc from "dayjs/plugin/utc";
import { DaisyTheme } from "../../daisy/index.js";
import { useExposeDebug } from "../../hooks/index.js";
var init = false;
export var StaticRootReactor = function () {
useExposeDebug({
dayjs: dayjs
});
if (!init) {
init = true;
setupDayjs();
}
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Toaster, null), /*#__PURE__*/ React.createElement(DaisyTheme.Sidecar, null));
};
function setupDayjs() {
dayjs.extend(relativeTime);
dayjs.extend(duration);
dayjs.extend(advancedFormat);
dayjs.extend(isToday);
dayjs.extend(dayOfYear);
// dayjs.extend(quarterOfYear);
// dayjs.extend(localeData);
dayjs.extend(utc);
dayjs.extend(timezone);
dayjs.locale("zh-cn");
dayjs.tz.setDefault("Asia/Shanghai");
return dayjs;
}