@beauraines/toggl-cli 0.10.13 → 0.10.15
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/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/utils.js +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.10.15](https://github.com/beauraines/toggl-cli/compare/v0.10.14...v0.10.15) (2023-04-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **deps:** bump toggl-client from 3.2.0 to 3.3.0 ([#65](https://github.com/beauraines/toggl-cli/issues/65)) ([020de32](https://github.com/beauraines/toggl-cli/commit/020de3229d48466af935e5d42570c878427cbdfe))
|
|
11
|
+
|
|
12
|
+
### [0.10.14](https://github.com/beauraines/toggl-cli/compare/v0.10.13...v0.10.14) (2023-04-01)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* adds color to current time entry ([ec660a7](https://github.com/beauraines/toggl-cli/commit/ec660a7fe383167fe306b0c1438814242066458a))
|
|
18
|
+
|
|
5
19
|
### [0.10.13](https://github.com/beauraines/toggl-cli/compare/v0.10.12...v0.10.13) (2023-04-01)
|
|
6
20
|
|
|
7
21
|
|
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Client from './client.js'
|
|
2
|
+
import chalk from 'chalk';
|
|
2
3
|
import dayjs from 'dayjs'
|
|
3
4
|
import utc from "dayjs/plugin/utc.js";
|
|
4
5
|
import timezone from 'dayjs/plugin/timezone.js';
|
|
@@ -103,15 +104,15 @@ export const displayTimeEntry = async function (timeEntry) {
|
|
|
103
104
|
if (!timeEntry) {
|
|
104
105
|
console.log('There is no time entry running!')
|
|
105
106
|
} else {
|
|
106
|
-
console.info(`${timeEntry.description}
|
|
107
|
-
console.info(`Billable: ${timeEntry.billable}`)
|
|
107
|
+
console.info(`${chalk.blueBright(timeEntry.description)} ${chalk.yellow('#'+timeEntry.id)}`)
|
|
108
|
+
console.info(`Billable: ${chalk.gray(timeEntry.billable)}`)
|
|
108
109
|
|
|
109
110
|
// TODO this should be abstracted for reuse
|
|
110
111
|
const startTime = dayjs.unix(timeEntry.duration * -1)
|
|
111
112
|
const duration = dayjs().diff(startTime, 's')
|
|
112
113
|
const durationFormatted = dayjs.duration(duration * 1000).format('H[h] m[m]')
|
|
113
114
|
|
|
114
|
-
console.info(`Duration: ${durationFormatted}`)
|
|
115
|
+
console.info(`Duration: ${chalk.green(durationFormatted)}`)
|
|
115
116
|
|
|
116
117
|
const projects = await getProjects(timeEntry.wid)
|
|
117
118
|
const project = projects.find(x => x.id == timeEntry.pid)
|