ant-design / ant-design/pro-components

🐛[BUG] ProDescriptions render 当valueType="date"时,实现了render后,无法显示时间格式

Open
#8,409 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🐛 bug 描述

ProDescriptions render 当valueType="date"时,实现了render后,无法显示时间格式

### 📷 复现步骤

```
{
title: 'Notes',
dataIndex: ['lastFollowupLog', 'created_at'],
valueType: 'date',
align: 'center',
renderText: (text, record) => {
return text && text * 1000 || text;
},
render: (dom, entity) => {
//无法正确显示时间格式,显示出来的值为原始值,但是注释render后,显示又是正确的
return [dom]
return entity?.lastFollowupLog &&


{dom}


|| '-';
},
},
```
### 🏞 期望结果

显示正确的时间格式

### 💻 复现代码

### © 版本信息

- ProComponents 版本: version: 2.7.0
- umi 版本
- 浏览器环境
- 开发环境 [e.g. mac OS]

### 🚑 其他信息

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied ProDescriptions configuration with valueType="date", renderText, and render, then trace how the date value is formatted before the custom render output. Confirm that wrapping or returning the rendered value still displays the formatted date rather than the raw timestamp, and add or update coverage for this case if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.