2013-10-29 38 views
0

我想知道哪些日期范围与IndexedDB中的另一个日期范围重叠。带范围查询的IndexedDB

类似下面的查询:

SELECT * FROM events 
WHERE (periodStart >= start AND periodStart < end) 
OR (start >= periodStart AND start <= periodEnd) 

活动看起来像以下对象:

[{ 
    title: 'foo', 
    start: 'Tue Oct 29 2013 10:19:52 GMT-0400 (EDT)', 
    end: 'Tue Oct 29 2013 13:19:52 GMT-0400 (EDT)' 
}, 
{ 
    title: 'bar', 
    start: 'Tue Oct 30 2013 00:00:00 GMT-0400 (EDT)', 
    end: 'Tue Oct 31 2013 00:00:00 GMT-0400 (EDT)' 
}] 
+0

[在IndexedDB中查询?]的可能重复(http://stackoverflow.com/questions/6405650/querying-in-indexeddb) –

回答

0

据我所知,没有能力做工会是IndexedDB(该OR)。

因此,有点不好意思,这里有一半可能会让你在课程中的解决方案:像找到集合的最小值和集合的最大值,然后查询降序和查询上升,但只是从每个光标获得第一条记录,然后,一些东西。