我正在使用完整日历并将此数组传递给完整日历[{"id":"11589","slot":"Morning",start: "2019-07-18T06:00:00",end: "2019-07-18T09:00:00"},{"id":"11590","slot":"Afternoon",start: "2019-07-18T00:00:00",end: "2019-07-18T00:00:00"},{"id":"11588","slot":"Evening",start: "2019-07-18T17:00:00",end: "2019-07-18T18:15:00"},{"id":"11587","slot":"Night",start: "2019-07-18T20:15:00",end: "2019-07-18T22:15:00"}]问题是我只想按这个顺序显示一天的事件,但我想要的是下午先来,然后是早上、晚上和晚上。输出 :Afternoon Morning Evening Night 所需输出:Morning AfternoonEvening Night
1 回答
狐的传说
TA贡献1804条经验 获得超3个赞
您的问题在于输入数组中的数据。
[{"id":"11589","slot":"Morning",start: "2019-07-18T06:00:00",end: "2019-07-18T09:00:00"},{"id":"11590","slot":"Afternoon",start: "2019-07-18T00:00:00",end: "2019-07-18T00:00:00"},{"id":"11588","slot":"Evening",start: "2019-07-18T17:00:00",end: "2019-07-18T18:15:00"},{"id":"11587","slot":"Night",start: "2019-07-18T20:15:00",end: "2019-07-18T22:15:00"}]
那天早上下午的时间戳较低,这就是它首先出现的原因。如果您切换日期,尤其是时间在这里很重要,那么一切正常,请参见下文:
[{"id":"11589","slot":"Morning",start: "2019-07-18T00:00:00",end: "2019-07-18T00:00:00"},{"id":"11590","slot":"Afternoon",start: "2019-07-18T06:00:00",end: "2019-07-18T09:00:00"},{"id":"11588","slot":"Evening",start: "2019-07-18T17:00:00",end: "2019-07-18T18:15:00"},{"id":"11587","slot":"Night",start: "2019-07-18T20:15:00",end: "2019-07-18T22:15:00"}]
- 1 回答
- 0 关注
- 153 浏览
添加回答
举报
0/150
提交
取消