@premieroctet/next-admin
Version:
Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje
19 lines (18 loc) • 681 B
JavaScript
import { jsx } from "react/jsx-runtime";
import { useFormState } from "../../context/FormStateContext.mjs";
import { getTemplate, utcToLocal } from "../../utils/rjsf.mjs";
function DateTimeWidget(props) {
const { onChange, value, options, registry } = props;
const BaseInputTemplate = getTemplate("BaseInputTemplate", registry, options);
const { setFieldDirty } = useFormState();
return /*#__PURE__*/ jsx(BaseInputTemplate, {
type: "datetime-local",
...props,
value: utcToLocal(value),
onChange: (value)=>{
setFieldDirty(props.name);
onChange(value);
}
});
}
export { DateTimeWidget as default };