我有一个startDate
和一个endDate
,我想拆分成startDate
和endDate
的数组吗?我的分配器是一个时隙(不是分页中的数字)。
我的打字稿代码是:
startDate: Date;
endDate: Date;
timeSlots: moment.Duration = moment.duration(30,'minutes');
我的startDate是2019-11-02T11:57:00.701Z
,而我的endDate 2019-11-02T13:31:00.701Z
我在寻找如何击退此结果的方法:
[
{startDate: 2019-11-02T11:57:00.701Z,endDate: 2019-11-02T12:26:59.701Z}
{startDate: 2019-11-02T12:27:00.701Z,endDate: 2019-11-02T12:56:59.701Z}
{startDate: 2019-11-02T12:57:00.701Z,endDate: 2019-11-02T13:26:59.701Z}
{startDate: 2019-11-02T13:27:00.701Z,endDate: 2019-11-02T13:31:00.701Z}
]