Skip to content

Commit

Permalink
show that a streak stars even before the displayed dates
Browse files Browse the repository at this point in the history
  • Loading branch information
zoreet committed Dec 20, 2023
1 parent bfbe91c commit 07bbe15
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Now
- show streak even if it's starting from before the 21(displayed days)

## Next
- pass Today as a variable
Expand All @@ -8,7 +9,6 @@
- allow user to create a habit from the tracker
- show only habits that have activity in the past 21 days
- settings page
- show streak even if it's starting from before the 21(displayed days)
- add dashboard for each habit with stats (current streak, avg streak, best streak, avg completion rate etc)

## Done
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "habit-tracker-21",
"name": "Habit Tracker 21",
"version": "1.0.2",
"version": "1.0.3",
"minAppVersion": "1.1.0",
"description": "Your 21-day journey to habit formation simplified",
"author": "Zoreet",
Expand Down
6 changes: 4 additions & 2 deletions src/HabitTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import { App, parseYaml, Notice, TAbstractFile } from 'obsidian';

const PLUGIN_NAME = "Habit Tracker 21"
const DAYS_TO_SHOW = 21;
/* i want to show that a streak is already ongoing even if the previous dates are not rendered
so I load an extra date in the range, but never display it in the UI */
const DAYS_TO_LOAD = 22;

interface HabitTrackerSettings {
path: string;
Expand All @@ -20,7 +22,7 @@ interface HabitTrackerSettings {

const DEFAULT_SETTINGS: HabitTrackerSettings = {
path: '',
range: DAYS_TO_SHOW,
range: DAYS_TO_LOAD,
rootElement: undefined,
habitsGoHere: undefined,
}
Expand Down
6 changes: 6 additions & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,9 @@ If your plugin does not need CSS, delete this file.
border-bottom-right-radius: 0;
width: 100%;
}

.habit-cell__name + * {
/* i want to show that a streak is already ongoing even if the previous dates are not rendered
so I load an extra date in the range, but never display it in the UI */
display: none;
}
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"1.0.0": "1.1.0",
"1.0.1": "1.1.0",
"1.0.2": "1.1.0"
"1.0.2": "1.1.0",
"1.0.3": "1.1.0"
}

0 comments on commit 07bbe15

Please sign in to comment.