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

导出日期变成了数字 #22

Closed
dashenxian opened this issue Jan 14, 2020 · 4 comments
Closed

导出日期变成了数字 #22

dashenxian opened this issue Jan 14, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@dashenxian
Copy link

版本:1.4.21
导出的模型属性类型DateTime?类型,excel数据是数字,要手动设置单元格格式才能变成日期
image

@xin-lai
Copy link
Collaborator

xin-lai commented Jan 16, 2020

我看看

@xin-lai xin-lai added the bug Something isn't working label Jan 16, 2020
@xin-lai
Copy link
Collaborator

xin-lai commented Jan 16, 2020

        /// <summary>
        /// 时间测试
        /// </summary>
        [ExporterHeader(DisplayName = "日期1", Format = "yyyy-MM-dd")]
        public DateTime Time1 { get; set; }

        /// <summary>
        /// 时间测试
        /// </summary>
        [ExporterHeader(DisplayName = "日期2", Format = "yyyy-MM-dd HH:mm:ss")]
        public DateTime? Time2 { get; set; }

xin-lai pushed a commit that referenced this issue Jan 16, 2020
- 【导出】修复日期格式默认导出数字的Bug,默认输出“yyyy-MM-dd”,可以通过设置“[ExporterHeader(DisplayName = "日期2", Format = "yyyy-MM-dd HH:mm:ss")]”来修改。问题见(<https://github.com/dotnetcore/Magicodes.IE/issues/22>)。
@xin-lai
Copy link
Collaborator

xin-lai commented Jan 16, 2020

非常感谢。
此问题已修复,可以使用1.4.24版本。默认输出“yyyy-MM-dd”,具体见更新日志。

@xin-lai xin-lai closed this as completed Jan 16, 2020
@booksir
Copy link

booksir commented Apr 22, 2021

为什么我使用2.5.3.6版本还是会出现,日期变数字的问题,同样需要去设置一下单元格格式才能显示出日期

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants