Skip to content

Commit 6745a6b

Browse files
feat(views): add WorkReport view with fixed date range handling
Fixes two bugs from the initial implementation in #742: - Fix startOfDay offset parsing: the settings value is "HH:MM" string but was passed raw to moment().add(), which expects a number+unit. Now parsed as [hours, minutes] and added separately. - Implement all date range options: thisWeek, thisMonth, and custom were advertised in the UI but not implemented in getTimeperiods(). All five options now work correctly. Also adds date picker inputs for the custom range, with sensible defaults (last 7 days). Co-Authored-By: Bob <timetobuildbob@gmail.com>
1 parent 1db85aa commit 6745a6b

3 files changed

Lines changed: 383 additions & 0 deletions

File tree

src/components/Header.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ div(:class="{'fixed-top-padding': fixedTopMenu}")
5959
b-dropdown-item(to="/search")
6060
icon(name="search")
6161
| Search
62+
b-dropdown-item(to="/work-report")
63+
icon(name="briefcase")
64+
| Work Report
6265
b-dropdown-item(to="/trends" v-if="devmode")
6366
icon(name="chart-line")
6467
| Trends
@@ -98,6 +101,7 @@ div(:class="{'fixed-top-padding': fixedTopMenu}")
98101
<script lang="ts">
99102
// only import the icons you use to reduce bundle size
100103
import 'vue-awesome/icons/calendar-day';
104+
import 'vue-awesome/icons/briefcase';
101105
import 'vue-awesome/icons/calendar-week';
102106
import 'vue-awesome/icons/stream';
103107
import 'vue-awesome/icons/database';

src/route.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const Trends = () => import('./views/Trends.vue');
1515
const Settings = () => import('./views/settings/Settings.vue');
1616
const CategoryBuilder = () => import('./views/settings/CategoryBuilder.vue');
1717
const Stopwatch = () => import('./views/Stopwatch.vue');
18+
const WorkReport = () => import('./views/WorkReport.vue');
1819
const Alerts = () => import('./views/Alerts.vue');
1920
const Search = () => import('./views/Search.vue');
2021
const Report = () => import('./views/Report.vue');
@@ -66,6 +67,7 @@ const router = new VueRouter({
6667
{ path: '/settings', component: Settings },
6768
{ path: '/settings/category-builder', component: CategoryBuilder },
6869
{ path: '/stopwatch', component: Stopwatch },
70+
{ path: '/work-report', component: WorkReport },
6971
{ path: '/search', component: Search },
7072
{ path: '/graph', component: Graph },
7173
{ path: '/dev', component: Dev },

0 commit comments

Comments
 (0)