md-time-track
v0.1.1
Published
Calculate key metrics and create detailed reports from specially formated markdown input containing time tracking data.
Downloads
1
Maintainers
Readme
md-time-track
Typescript-based node module for parsing markdown based time tracking information. The core module of the md-time-track project.
Description
Uses specially formated markdown files as input to calculate worktime and detailed reports.
Usage
import { parse } from 'md-time-track';
var input = `
### 02.03.2021
- Did something for Project A [9:00 - 11:00, #projectA]
- Did something for Project B [ - 12:00, #projectB]
- Break [ - 13:00, #break]
- Check mails [ - 14:00, #general/mails]
### 03.03.2021
- Did more for Project A [6:00 - 8:00, #projectA]
- Did something for Project C [ - 12:00, #projectC]
- Break [ - 13:00, #break]
- Call [ - 15:00, #general/call]
`
let { days, parse_errors } = parse(input);
console.log(days)
will yield
[
{
"logItems": [
{
"startDate": "2021-03-02T08:00:00.000Z",
"endDate": "2021-03-02T10:00:00.000Z",
"tags": [
"#projectA"
],
"lineNumber": 5
},
{
"startDate": "2021-03-02T10:00:00.000Z",
"endDate": "2021-03-02T11:00:00.000Z",
"tags": [
"#projectB"
],
"lineNumber": 6
},
{
"startDate": "2021-03-02T11:00:00.000Z",
"endDate": "2021-03-02T12:00:00.000Z",
"tags": [
"#break"
],
"lineNumber": 7
},
{
"startDate": "2021-03-02T12:00:00.000Z",
"endDate": "2021-03-02T13:00:00.000Z",
"tags": [
"#general/mails"
],
"lineNumber": 8
}
],
"date": "2021-03-01T23:00:00.000Z",
"lineNumber": 4
},
{
"logItems": [
{
"startDate": "2021-03-03T05:00:00.000Z",
"endDate": "2021-03-03T07:00:00.000Z",
"tags": [
"#projectA"
],
"lineNumber": 11
},
{
"startDate": "2021-03-03T07:00:00.000Z",
"endDate": "2021-03-03T11:00:00.000Z",
"tags": [
"#projectC"
],
"lineNumber": 12
},
{
"startDate": "2021-03-03T11:00:00.000Z",
"endDate": "2021-03-03T12:00:00.000Z",
"tags": [
"#break"
],
"lineNumber": 13
},
{
"startDate": "2021-03-03T12:00:00.000Z",
"endDate": "2021-03-03T14:00:00.000Z",
"tags": [
"#general/call"
],
"lineNumber": 14
}
],
"date": "2021-03-02T23:00:00.000Z",
"lineNumber": 10
}
]