You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 453 B

12345678910111213141516171819
  1. /*
  2. * @Author: 赵伟
  3. * @Date: 2024-04-28 14:18:11
  4. * @Description: 自定义 Table 日期类单元格
  5. */
  6. import dayjs from 'dayjs';
  7. function DateTableCell(text?: string | null) {
  8. if (text === undefined || text === null || text === '') {
  9. return <span>--</span>;
  10. }
  11. if (!dayjs(text).isValid()) {
  12. return <span>无效的日期</span>;
  13. }
  14. return <span>{dayjs(text).format('YYYY-MM-DD HH:mm:ss')}</span>;
  15. }
  16. export default DateTableCell;