ant-design / ant-design/pro-components

👑 [需求]增加时间格式处理全局配置及区分时间展示格式和value格式

Open
#8,598 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

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

### 🔩 所属模块或组件

时间选择器相关组件

### 🥰 需求描述
可以全局配置日/月/年/周/财年等的格式,格式分为

- format 用于界面展示格式,支持函数
- valueFormat 在表单中用于传输的格式,支持函数

### ⛰ 功能需求适用场景

1. pro-components 有一套默认的时间处理,也支持在具体使用的地方修改,每次都要写相同的代码,希望可以全局配置
2. 区分format和valueFormat 的原因是因为做国际化处理时,我们需要为不同的地区展示不同的时间格式,但是接口传值却是固定的。
比如接口需要YYYY-MM-DD,但是界面需要DD/MM/YYYY,或者DD-MM-YYYY

### 🧐 解决方案

### 🚑 其他信息

Contributor guide

Open the contributing guide

Research direction

Start by locating the time-picker-related components and reviewing how pro-components currently provide default time handling. Map the existing component-level format options before defining the scope of global configuration and the distinction between display and form value formats. Done should include agreed behavior for the listed date units, function support, and internationalized display versus fixed API values.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.