【发布时间】:2020-06-17 08:39:17
【问题描述】:
我有一个基本的甘特图,其中包含一组项目,每个任务看起来像这样:
{
text: "test title"
start_date: "2020-03-21"
end_date: "2020-03-27"
projectNumber: "3525"
id: 95
}
我的 date_format 设置如下:
gantt.config.date_format = '%Y-%m-%d';
数据加载正常,图表填充了数据,但是当我通过 Id 获取任务或显示所有图表任务时,输出将日期显示为对象,而不是像我最初设置的字符串那样。这是一个示例输出:
text: "test"
start_date: Sat Mar 21 2020 00:00:00 GMT-0400 (Eastern Daylight Time) {}
end_date: Fri Mar 27 2020 00:00:00 GMT-0400 (Eastern Daylight Time) {}
projectNumber: "48"
id: 9
progress: 0
$no_start: false
$no_end: false
$rendered_type: "task"
duration: 6
$source: []
$target: []
parent: 0
$rendered_parent: 0
$level: 0
$open: false
$index: 0
为什么开始和结束日期字符串的格式与我插入它们时的格式不同?这是甘特图的默认行为吗?
【问题讨论】: