@aicupa/plugin-balance 1.0.5 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aicupa/plugin-balance",
3
- "version": "1.0.5",
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)) {
@@ -1,21 +0,0 @@
1
- name: Npm Publish
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v*.*.*'
7
-
8
- jobs:
9
- Npm-Publish:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - name: Checkout
13
- uses: actions/checkout@v2.3.4
14
-
15
- - name: Install Deps
16
- run: yarn install
17
-
18
- - name: publish with latest tag
19
- uses: JS-DevTools/npm-publish@v1
20
- with:
21
- token: ${{ secrets.NPM_AUTH_TOKEN }}