|
@@ -17,6 +17,9 @@ import RegisterAvailableList from './components/register.available.list';
|
|
|
import { RegisterInfo, registerWork } from '@/API/patient/workActions';
|
|
|
import useRegisterState from '@/hooks/useRegisterState';
|
|
|
import registerformSchema from '@/validation/patient/registerSchema';
|
|
|
+import dayjs from 'dayjs';
|
|
|
+import utc from 'dayjs/plugin/utc';
|
|
|
+dayjs.extend(utc);
|
|
|
|
|
|
const { useBreakpoint } = Grid;
|
|
|
const { Panel } = Collapse;
|
|
@@ -28,10 +31,13 @@ const RegisterPage: React.FC = () => {
|
|
|
|
|
|
const handleRegister = async () => {
|
|
|
try {
|
|
|
- const values = form.getFieldsValue();
|
|
|
- values.patient_dob = values.patient_dob
|
|
|
- ? values.patient_dob.toString('YYYY-MM-DD[T00:00:00.000000Z]')
|
|
|
+ let values = form.getFieldsValue();
|
|
|
+ const formatDob = values.patient_dob
|
|
|
+ ? dayjs.utc(values.patient_dob).format('YYYY-MM-DDTHH:mm:ss.SSS[Z]') //values.patient_dob.toString('YYYY-MM-DD[T00:00:00.000000Z]')
|
|
|
: '';
|
|
|
+ console.log(`转换后的日期:${formatDob}`);
|
|
|
+
|
|
|
+ values = { ...values, patient_dob: formatDob };
|
|
|
console.log(`${JSON.stringify(values, null, 2)}`);
|
|
|
|
|
|
const validateResult = registerformSchema.safeParse(values);
|