Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable 对于 datetime列 能不能显示自定义格式? #2281

Closed
huxinshuo opened this issue Dec 14, 2024 · 5 comments
Closed

DataTable 对于 datetime列 能不能显示自定义格式? #2281

huxinshuo opened this issue Dec 14, 2024 · 5 comments
Labels
status/resolved The issue has been fixed status/stale type/question Further information is requested

Comments

@huxinshuo
Copy link

Proposal and motivation

DataTable 对于 datetime 列能不能自定义格式?
比如只显示日期不显示 时间? 日期格式定义为年-月-日之类的
好像C#没有单纯的日期格式 只有 datetime格式
所以DataTable 能不能支持对日期的一些自定义?

Additional context

No response

@huxinshuo huxinshuo added the type/enhancement New feature or request label Dec 14, 2024
@huxinshuo
Copy link
Author

表格里面显示格式是这样的:1/1/2024 12:00:00 AM . 能不能显示2024-01-01?

@capdiem
Copy link
Contributor

capdiem commented Dec 14, 2024

@huxinshuo 文档有例子啊,使用ItemColContent或者CellRender。

@capdiem capdiem added type/question Further information is requested status/resolved The issue has been fixed and removed type/enhancement New feature or request labels Dec 14, 2024
@huxinshuo
Copy link
Author

@capdiem
CellRender = Tasks => Tasks.PayDate.ToString("yyyy-MM-dd") 这个好像无效 还是显示1/1/2024 12:00:00 AM 能否设置某个列的格式为日期格式?因为查看row信息在dialog要datetime格式。
CellRender好像只是转换文本。

@capdiem
Copy link
Contributor

capdiem commented Dec 15, 2024

@huxinshuo 你是不是已经用了ItemColContent?它和CellRender不能一起用。Dialog里格式再自己转换一下。

Copy link

This issue is stale because it has been open for 4 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/resolved The issue has been fixed status/stale type/question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants