简体   繁体   English

角剑道网格列日期格式

[英]Angular Kendo Grid Column Date Format

I have a kendo grid column like so: 我有一个剑道网格列,如下所示:

<kendo-grid-column field="EntryDate" title="Date" filter="date" [format]="{ date: 'long' }"></kendo-grid-column>

The data looks like so: 数据如下所示:

"EntryDate":"2018-05-01T00:00:00-05:00"

The grid shows the date unformatted. 网格显示未格式化的日期。 How can I get the date to show formatted correctly in the grid? 如何获取日期以正确显示网格中的格式?

The Grid data needs to contain actual JavaScript Date objects as opposed to some string representations. Grid数据需要包含实际的JavaScript Date对象,而不是某些字符串表示形式。 Then built-in formatting, sorting, filtering and editing will treat the dates as such and will work as expected: 然后,内置的格式化,排序,过滤和编辑功能将对日期进行处理,并且将按预期工作:

DOCS DOCS

Map the data so that it contains actual dates. 映射数据,使其包含实际日期。

EXAMPLES: 例子:

String

Date 日期

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM