完整日历未按正确顺序对日期事件进行排序

Full Calendar Not Sorting events of days in correct order

我正在使用完整日历并将此数组传递给完整日历

[{"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"}]

问题是我只想按此顺序显示一天中的事件,但我想要的是下午先到,然后是早上、晚上和晚上。

Output :

Afternoon 
Morning 
Evening 
Night 

Required Output:

Morning 
Afternoon
Evening 
Night 

你的问题出在你输入数组的数据上。

[{"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"}]