diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 6b9afae61..48c6b547c 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -221,6 +221,11 @@ "view_next31" = "Next 31 days"; "view_thismonth" = "This Month"; "view_thisyear" = "This Year"; +"view_last7" = "Last 7 days"; +"view_last14" = "Last 14 days"; +"view_last31" = "Last 31 days"; +"view_lastmonth" = "Last Month"; +"view_lastyear" = "Last Year"; "view_future" = "All Future Events"; "view_selectedday" = "Selected Day"; "view_not_started" = "Not started tasks"; diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 1866edcc0..b0fa19155 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -214,6 +214,48 @@ static NSArray *tasksFields = nil; } endDate = [startDate endOfDay]; } + else if ([popupValue isEqualToString: @"view_last7"]) + { + endDate = [NSCalendarDate calendarDate]; + [endDate setTimeZone: userTZ]; + startDate = [[endDate dateByAddingYears: 0 months: 0 days: -6] beginOfDay]; + } + else if ([popupValue isEqualToString: @"view_last14"]) + { + endDate = [NSCalendarDate calendarDate]; + [endDate setTimeZone: userTZ]; + startDate = [[endDate dateByAddingYears: 0 months: 0 days: -13] beginOfDay]; + } + else if ([popupValue isEqualToString: @"view_last31"]) + { + endDate = [NSCalendarDate calendarDate]; + [endDate setTimeZone: userTZ]; + startDate = [[endDate dateByAddingYears: 0 months: 0 days: -30] beginOfDay]; + } + else if ([popupValue isEqualToString: @"view_lastmonth"]) + { + newDate = [NSCalendarDate calendarDate]; + [newDate setTimeZone: userTZ]; + endDate = [[[newDate firstDayOfMonth] dateByAddingYears:0 months:0 days:-1 hours:0 minutes:0 seconds:0] endOfDay]; + startDate = [[endDate firstDayOfMonth] beginOfDay]; + } + else if ([popupValue isEqualToString: @"view_lastyear"]) + { + newDate = [NSCalendarDate dateWithYear: [[NSCalendarDate calendarDate] yearOfCommonEra] - 1 + month: 1 + day: 1 + hour: 0 minute: 0 second: 0 + timeZone: userTZ]; + startDate = [[newDate firstDayOfMonth] beginOfDay]; + + newDate = [NSCalendarDate dateWithYear: [[NSCalendarDate calendarDate] yearOfCommonEra] - 1 + month: 12 + day: 31 + hour: 0 minute: 0 second: 0 + timeZone: userTZ]; + endDate = [[newDate lastDayOfMonth] endOfDay]; + } + NSLog(@"***[UIxCalListingActions _setupDatesWithPopup:%@ andUserTZ:%@] %@ => %@", popupValue, userTZ, startDate, endDate); } - (void) _setupContext @@ -1672,7 +1714,12 @@ _computeBlocksPosition (NSArray *blocks) [tasksView isEqualToString:@"view_next14"] || [tasksView isEqualToString:@"view_next31"] || [tasksView isEqualToString:@"view_thismonth"] || - [tasksView isEqualToString:@"view_thisyear"]) && + [tasksView isEqualToString:@"view_thisyear"] || + [tasksView isEqualToString:@"view_last7"] || + [tasksView isEqualToString:@"view_last14"] || + [tasksView isEqualToString:@"view_last31"] || + [tasksView isEqualToString:@"view_lastmonth"] || + [tasksView isEqualToString:@"view_lastyear"]) && (endDateStamp == 0 || endDateStamp >= startSecs)) [filteredTasks addObject: filteredTask]; else if ([tasksView isEqualToString:@"view_all"]) diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index 6b310a073..4c43de4e9 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -202,6 +202,31 @@ {{ list.filteredBy('view_thisyear') ? 'check' : null }} + + + {{ list.filteredBy('view_last7') ? 'check' : null }} + + + + + {{ list.filteredBy('view_last14') ? 'check' : null }} + + + + + {{ list.filteredBy('view_last31') ? 'check' : null }} + + + + + {{ list.filteredBy('view_lastmonth') ? 'check' : null }} + + + + + {{ list.filteredBy('view_lastyear') ? 'check' : null }} + + {{ list.filteredBy('view_future') ? 'check' : null }}