JavaScript中json对象的时间段

我们有书籍对象数组。

{'zone': 'z1', book: 'book1', timestamp: '01/01/2020'}
{'zone': 'z1', book: 'book1', timestamp: '03/01/2020'}
{'zone': 'z2', book: 'book1', timestamp: '04/01/2020'}
{'zone': 'z2', book: 'book1', timestamp: '05/01/2020'}
{'zone': 'z2', book: 'book1', timestamp: '10/01/2020'}
{'zone': 'z2', book: 'book1', timestamp: '12/01/2020'}
{'zone': 'z1', book: 'book1', timestamp: '15/01/2020'}
{'zone': 'z1', book: 'book1', timestamp: '16/01/2020'}
{'zone': 'z1', book: 'book1', timestamp: '20/01/2020'}

我想要一个函数,它可以返回书在区域之间的完整旅程,而书却可以在区域内来回移动。

如果我们查询book1的预期输出:

[ 
    {
        zone: 'z1'
        start: '01/01/2020'
        end: '04/01/2020'
    },
    {
        zone: 'z2'
        start: '05/03/2020'
        end: '12/01/2020'
    },
    {
        zone: 'z1'
        start: '15/03/2020'
        end: '20/01/2020'
    }
]