Implement time-range filter
This commit is contained in:
@@ -340,9 +340,14 @@ class _MessageListPageState extends State<MessageListPage> with RouteAware {
|
||||
|
||||
var chipletsTimeRange = _filterChiplets.where((p) => p.type == MessageFilterChipletType.timeRange).toList();
|
||||
if (chipletsTimeRange.isNotEmpty) {
|
||||
//TODO
|
||||
//filter.timeAfter = chipletsTimeRange[0].value1 as DateTime;
|
||||
//filter.timeBefore = chipletsTimeRange[0].value2 as DateTime;
|
||||
var t0 = (chipletsTimeRange[0].value as DateTimeRange).start.toLocal();
|
||||
var t1 = (chipletsTimeRange[0].value as DateTimeRange).end.toLocal();
|
||||
|
||||
t0 = DateTime(t0.year, t0.month, t0.day, 0, 0, 0, 0);
|
||||
t1 = DateTime(t1.year, t1.month, t1.day, 23, 59, 59, 999);
|
||||
|
||||
filter.timeAfter = t0;
|
||||
filter.timeBefore = t1;
|
||||
}
|
||||
|
||||
return filter;
|
||||
|
||||
Reference in New Issue
Block a user