@aicupa/plugin-balance 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/service.js +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicupa/plugin-balance",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Show time balance ratio between temporary and current tasks",
5
5
  "main": "./service",
6
6
  "view": "./view",
package/service.js CHANGED
@@ -32,7 +32,7 @@ module.exports = createPlugin((api) => {
32
32
  let total = 0;
33
33
 
34
34
  const today = new Date();
35
- today.setHours(0, 0, 0, 0);
35
+ today.setHours(8, 0, 0, 0);
36
36
  const startOfDayTimestamp = today.getTime();
37
37
 
38
38
  if (!node) return total;
@@ -46,7 +46,13 @@ module.exports = createPlugin((api) => {
46
46
  n.todo.end > n.todo.start
47
47
  ) {
48
48
  if (n.todo.keep) continue;
49
- if (n.todo.start < startOfDayTimestamp) continue;
49
+
50
+ let end = n.todo.end;
51
+ let start = n.todo.start;
52
+
53
+ if (start < startOfDayTimestamp) {
54
+ start = startOfDayTimestamp;
55
+ }
50
56
  total += n.todo.end - n.todo.start;
51
57
  }
52
58
  if (Array.isArray(n.children)) {