Просмотр исходного кода

🐛 fix(admin): 修复日期选择器显示问题

- 导入dayjs库处理日期格式
- 将日期转换方式从new Date改为dayjs,解决日期显示异常问题
yourname 5 месяцев назад
Родитель
Сommit
90a05d2891
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/client/admin/pages/DateNotesPage.tsx

+ 2 - 1
src/client/admin/pages/DateNotesPage.tsx

@@ -1,3 +1,4 @@
+import dayjs from 'dayjs';
 import React, { useState, useEffect } from 'react';
 import { Table, Button, Modal, Form, Input, DatePicker, Space, Typography, message, Tag } from 'antd';
 import { PlusOutlined, EditOutlined, DeleteOutlined, SearchOutlined } from '@ant-design/icons';
@@ -83,7 +84,7 @@ export const DateNotesPage: React.FC = () => {
     setCurrentItem(record);
     form.setFieldsValue({
       code: record.code,
-      noteDate: record.noteDate ? new Date(record.noteDate) : null,
+      noteDate: record.noteDate ? dayjs(record.noteDate) : null,
       note: record.note,
     });
     setIsModalVisible(true);