mirror of
https://github.com/Ellpeck/ObsidianSimpleTimeTracker.git
synced 2024-12-19 03:39:23 +01:00
Merge remote-tracking branch 'origin/master'
# Conflicts: # manifest.json # package.json # versions.json
This commit is contained in:
commit
7aa91901c6
8 changed files with 1736 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "simple-time-tracker",
|
"id": "simple-time-tracker",
|
||||||
"name": "Super Simple Time Tracker",
|
"name": "Super Simple Time Tracker",
|
||||||
"version": "0.1.5",
|
"version": "0.1.6",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "Multi-purpose time trackers for your notes!",
|
"description": "Multi-purpose time trackers for your notes!",
|
||||||
"author": "Ellpeck",
|
"author": "Ellpeck",
|
||||||
|
|
1710
package-lock.json
generated
1710
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "simple-time-tracker",
|
"name": "simple-time-tracker",
|
||||||
"version": "0.1.5",
|
"version": "0.1.6",
|
||||||
"description": "Multi-purpose time trackers for your notes!",
|
"description": "Multi-purpose time trackers for your notes!",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -204,6 +204,12 @@ function formatTimestamp(timestamp: number, settings: SimpleTimeTrackerSettings)
|
||||||
function formatDuration(totalTime: number): string {
|
function formatDuration(totalTime: number): string {
|
||||||
let duration = moment.duration(totalTime);
|
let duration = moment.duration(totalTime);
|
||||||
let ret = "";
|
let ret = "";
|
||||||
|
if (duration.years() > 0)
|
||||||
|
ret += duration.years() + "y ";
|
||||||
|
if (duration.months() > 0)
|
||||||
|
ret += duration.months() + "m ";
|
||||||
|
if (duration.days() > 0)
|
||||||
|
ret += duration.days() + "d ";
|
||||||
if (duration.hours() > 0)
|
if (duration.hours() > 0)
|
||||||
ret += duration.hours() + "h ";
|
ret += duration.hours() + "h ";
|
||||||
if (duration.minutes() > 0)
|
if (duration.minutes() > 0)
|
||||||
|
|
|
@ -259,6 +259,12 @@ function formatTimestamp(timestamp, settings) {
|
||||||
function formatDuration(totalTime) {
|
function formatDuration(totalTime) {
|
||||||
let duration = import_obsidian2.moment.duration(totalTime);
|
let duration = import_obsidian2.moment.duration(totalTime);
|
||||||
let ret = "";
|
let ret = "";
|
||||||
|
if (duration.years() > 0)
|
||||||
|
ret += duration.years() + "y ";
|
||||||
|
if (duration.months() > 0)
|
||||||
|
ret += duration.months() + "m ";
|
||||||
|
if (duration.days() > 0)
|
||||||
|
ret += duration.days() + "d ";
|
||||||
if (duration.hours() > 0)
|
if (duration.hours() > 0)
|
||||||
ret += duration.hours() + "h ";
|
ret += duration.hours() + "h ";
|
||||||
if (duration.minutes() > 0)
|
if (duration.minutes() > 0)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "simple-time-tracker",
|
"id": "simple-time-tracker",
|
||||||
"name": "Super Simple Time Tracker",
|
"name": "Super Simple Time Tracker",
|
||||||
"version": "0.1.5",
|
"version": "0.1.6",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "Multi-purpose time trackers for your notes!",
|
"description": "Multi-purpose time trackers for your notes!",
|
||||||
"author": "Ellpeck",
|
"author": "Ellpeck",
|
||||||
|
|
11
test-vault/duration_accumulation_test.md
Normal file
11
test-vault/duration_accumulation_test.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Notes
|
||||||
|
More notes for my cool project! This note shows that we can correctly display accumulated time that lasts longer than a 24 hour day!
|
||||||
|
|
||||||
|
```simple-time-tracker
|
||||||
|
{"entries":[
|
||||||
|
{"name":"test","startTime":1596265200,"endTime":1627887600,"subEntries":null},
|
||||||
|
{"name":"test","startTime":1627801200,"endTime":1633158000,"subEntries":null},
|
||||||
|
{"name":"test","startTime":1659337200,"endTime":1659423600,"subEntries":null},
|
||||||
|
{"name":"test","startTime":1664627410,"endTime":1664631605,"subEntries":null}
|
||||||
|
]}
|
||||||
|
```
|
|
@ -5,5 +5,6 @@
|
||||||
"0.1.2": "0.15.0",
|
"0.1.2": "0.15.0",
|
||||||
"0.1.3": "0.15.0",
|
"0.1.3": "0.15.0",
|
||||||
"0.1.4": "0.15.0",
|
"0.1.4": "0.15.0",
|
||||||
"0.1.5": "0.15.0"
|
"0.1.5": "0.15.0",
|
||||||
|
"0.1.6": "0.15.0"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue