@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 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 c2cli
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/c2cli/config.json`. Created automatically on `c2 setup`.
121
+ Config lives at `~/.config/c2/config.json`. Created automatically on `c2 setup`.
122
122
 
123
123
  ```json
124
124
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@richhaase/c2",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "CLI tool for syncing and analyzing Concept2 rowing data",
5
5
  "keywords": [
6
6
  "concept2",
@@ -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 c2cli &middot; Data from Concept2 Logbook &middot; ${fullDate(today)}
654
+ Generated by c2 &middot; Data from Concept2 Logbook &middot; ${fullDate(today)}
655
655
  </div>
656
656
 
657
657
  </body>
package/src/config.ts CHANGED
@@ -19,7 +19,7 @@ export function defaultConfig(): Config {
19
19
  }
20
20
 
21
21
  export function configDir(): string {
22
- return join(homedir(), ".config", "c2cli");
22
+ return join(homedir(), ".config", "c2");
23
23
  }
24
24
 
25
25
  export function dataDir(): string {
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 idx = Math.floor((monday.getTime() - cutoff.getTime()) / (1000 * 60 * 60 * 24 * 7));
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]!;