diff --git a/src/commands/CMakeLists.txt b/src/commands/CMakeLists.txt index c0ca647a..9651c7f5 100644 --- a/src/commands/CMakeLists.txt +++ b/src/commands/CMakeLists.txt @@ -19,7 +19,6 @@ set (commands_SRCS CmdCancel.cpp CmdReport.cpp CmdReportDay.cpp CmdReportMonth.cpp - CmdReportWeek.cpp CmdStart.cpp CmdStop.cpp CmdReportSummary.cpp diff --git a/src/commands/CmdReportMonth.cpp b/src/commands/CmdReportMonth.cpp index dde28966..7e14cbfe 100644 --- a/src/commands/CmdReportMonth.cpp +++ b/src/commands/CmdReportMonth.cpp @@ -43,6 +43,20 @@ static void renderExclusionBlocks (const std::string&, const Rules&, std::vector static void renderInterval (const std::string&, const Rules&, std::vector &, const Datetime&, const Interval&, Palette&, std::map &, time_t&); static void renderSummary (const std::string&, const Interval&, const std::vector &, const std::vector &); +//////////////////////////////////////////////////////////////////////////////// +int CmdReportWeek ( + const CLI& cli, + Rules& rules, + Database& database) +{ + // Create a filter, and if empty, choose the current month. + auto filter = getFilter (cli); + if (! filter.range.is_started ()) + filter.range = Range (Datetime ("socw"), Datetime ("eocw")); + + return renderReport ("week", filter, rules, database); +} + //////////////////////////////////////////////////////////////////////////////// int CmdReportMonth ( const CLI& cli, diff --git a/src/commands/CmdReportWeek.cpp b/src/commands/CmdReportWeek.cpp deleted file mode 100644 index 7b04c988..00000000 --- a/src/commands/CmdReportWeek.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Copyright 2015 - 2016, Paul Beckingham, Federico Hernandez. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// http://www.opensource.org/licenses/mit-license.php -// -//////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - -//////////////////////////////////////////////////////////////////////////////// -int CmdReportWeek ( - const CLI& cli, - Rules& rules, - Database& database) -{ - std::cout << "# CmdReportWeek\n"; - return 0; -} - -////////////////////////////////////////////////////////////////////////////////