@richhaase/c2 0.1.1 → 0.2.0
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/README.md +2 -2
- package/package.json +1 -1
- package/src/commands/report.ts +1 -1
- package/src/config.ts +1 -1
- package/src/stats.ts +2 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ bun install -g @richhaase/c2
|
|
|
12
12
|
|
|
13
13
|
# Or install from source
|
|
14
14
|
git clone https://github.com/richhaase/c2.git
|
|
15
|
-
cd
|
|
15
|
+
cd c2
|
|
16
16
|
bun install
|
|
17
17
|
bun link
|
|
18
18
|
```
|
|
@@ -118,7 +118,7 @@ c2 export -f jsonl > workouts.jsonl
|
|
|
118
118
|
|
|
119
119
|
## Configuration
|
|
120
120
|
|
|
121
|
-
Config lives at `~/.config/
|
|
121
|
+
Config lives at `~/.config/c2/config.json`. Created automatically on `c2 setup`.
|
|
122
122
|
|
|
123
123
|
```json
|
|
124
124
|
{
|
package/package.json
CHANGED
package/src/commands/report.ts
CHANGED
|
@@ -651,7 +651,7 @@ ${buildRecentWorkouts(allWorkouts, recentCount)}
|
|
|
651
651
|
${buildProjection(goal, allWorkouts)}
|
|
652
652
|
|
|
653
653
|
<div style="text-align: center; color: #484f58; font-size: 12px; margin-top: 32px; padding-bottom: 16px;">
|
|
654
|
-
Generated by
|
|
654
|
+
Generated by c2 · Data from Concept2 Logbook · ${fullDate(today)}
|
|
655
655
|
</div>
|
|
656
656
|
|
|
657
657
|
</body>
|
package/src/config.ts
CHANGED
package/src/stats.ts
CHANGED
|
@@ -71,7 +71,8 @@ export function buildWeekSummaries(workouts: Workout[], now: Date, weeks: number
|
|
|
71
71
|
if (t < cutoff || t > now) continue;
|
|
72
72
|
|
|
73
73
|
const monday = mondayOf(t);
|
|
74
|
-
const
|
|
74
|
+
const diffDays = Math.round((monday.getTime() - cutoff.getTime()) / (1000 * 60 * 60 * 24));
|
|
75
|
+
const idx = Math.floor(diffDays / 7);
|
|
75
76
|
if (idx < 0 || idx >= weeks) continue;
|
|
76
77
|
|
|
77
78
|
const ws = summaries[idx]!;
|