Skip to content

Commit 5d9c8ba

Browse files
committed
#123: Filter for Today and Tomorrow
1 parent 4e0e565 commit 5d9c8ba

File tree

9 files changed

+1045
-606
lines changed

9 files changed

+1045
-606
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ In particular, see these solutions:
9898

9999
<a id="v4.7"/>
100100

101-
### 2023-12-30 v4.7.1 Show based on keywords in a title
101+
### 2023-12-31 v4.7.2 Show based on keywords in a title
102+
* Date range filtering extended with "[Today and Tomorrow](https://github.com/plusonelabs/calendar-widget/issues/123)"
103+
option. This is different from the "One day" option as that hides events after current time on the next day,
104+
which is a bit confusing.
102105
* [Show based on keywords in a title](https://github.com/plusonelabs/calendar-widget/issues/122) option added,
103106
allowing to see events that have certain text included.
104107
In addition to existing option "Hide based on keywords in a title".

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
}
1212

1313
defaultConfig {
14-
versionCode 701
15-
versionName '4.7.1'
14+
versionCode 702
15+
versionName '4.7.2'
1616
minSdkVersion rootProject.minSdkVersion
1717
targetSdkVersion rootProject.targetSdkVersion
1818

app/src/androidTest/java/org/andstatus/todoagenda/TomorrowsTasksInTodaysFilterTest.java

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.andstatus.todoagenda;
22

3-
import static org.junit.Assert.assertEquals;
3+
import static org.andstatus.todoagenda.prefs.InstanceSettings.EVENT_RANGE_TODAY;
4+
import static org.andstatus.todoagenda.prefs.InstanceSettings.EVENT_RANGE_TODAY_AND_TOMORROW;
45

56
import org.andstatus.todoagenda.provider.QueryResultsStorage;
67
import org.andstatus.todoagenda.widget.WidgetEntryPosition;
@@ -15,11 +16,18 @@ public class TomorrowsTasksInTodaysFilterTest extends BaseWidgetTest {
1516
public void testIssue102() {
1617
final String method = "testIssue102";
1718
QueryResultsStorage inputs = provider.loadResultsAndSettings(
18-
org.andstatus.todoagenda.test.R.raw.tomorrows_tasks_today);
19+
org.andstatus.todoagenda.test.R.raw.tomorrows_tasks_one_week);
1920
provider.addResults(inputs);
2021

2122
playResults(method);
22-
assertEquals("Number of entries, " + getFactory().getWidgetEntries(), 1, getFactory().getWidgetEntries().size());
23-
assertEquals("No events", WidgetEntryPosition.LIST_FOOTER, getFactory().getWidgetEntries().get(0).entryPosition);
23+
assertPosition(10, WidgetEntryPosition.LIST_FOOTER);
24+
25+
getSettings().eventRange = EVENT_RANGE_TODAY;
26+
playResults(method);
27+
assertPosition(0, WidgetEntryPosition.LIST_FOOTER);
28+
29+
getSettings().eventRange = EVENT_RANGE_TODAY_AND_TOMORROW;
30+
playResults(method);
31+
assertPosition(7, WidgetEntryPosition.LIST_FOOTER);
2432
}
2533
}

0 commit comments

Comments
 (0)