diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/app.model.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/js/app.model.js b/js/app.model.js index 17257e6..91fe62c 100644 --- a/js/app.model.js +++ b/js/app.model.js @@ -95,13 +95,26 @@ var Model = function Model() { * @returns {AttributeRangeFilter} */ getStartDateFilter: function Model_getStartDateFilter(date) { - var tzDate1 = new tizen.TZDate(date.getFullYear(), date.getMonth(), date.getDate()+1), - tzDate2 = new tizen.TZDate(date.getFullYear(), date.getMonth(), date.getDate()); + var today = new tizen.TZDate(date.getFullYear(), date.getMonth(), date.getDate()), + tomorrow = new tizen.TZDate(date.getFullYear(), date.getMonth(), date.getDate()+1); return new tizen.CompositeFilter( - "INTERSECTION", + "UNION", [ - new tizen.AttributeRangeFilter("startDate", null, tzDate1), - new tizen.AttributeRangeFilter("endDate", tzDate2, null) + new tizen.CompositeFilter( + "INTERSECTION", + [ + new tizen.AttributeFilter("isAllDay", "EXACTLY", false), + new tizen.AttributeRangeFilter("startDate", null, tomorrow), + new tizen.AttributeRangeFilter("endDate", today, null) + ] + ), + new tizen.CompositeFilter( + "INTERSECTION", + [ + new tizen.AttributeFilter("isAllDay", "EXACTLY", true), + new tizen.AttributeRangeFilter("startDate", tomorrow, tomorrow), + ] + ) ] ); }, |