opencode-statboard 2.10.22 → 2.10.23

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-statboard",
3
- "version": "2.10.22",
3
+ "version": "2.10.23",
4
4
  "description": "Real-time dashboard for opencode token usage and cost statistics",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -277,8 +277,8 @@ function refreshTrend(days) {
277
277
  return { trend: hit ? Object.assign({}, hit, { stale: true }) : null, pending };
278
278
  }
279
279
 
280
- function localDayKey(d) { return `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`; }
281
- function dateOfKey(k) { const [y, m, d] = k.split('-').map(Number); return new Date(y, m, d); }
280
+ function localDayKey(d) { const p = (n) => String(n).padStart(2, '0'); return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())}`; }
281
+ function dateOfKey(k) { const [y, m, d] = k.split('-').map(Number); return new Date(y, m - 1, d); }
282
282
  function modelNameOf(provider, model) { return `${provider || 'unknown'}/${model || 'unknown'}`; }
283
283
  function splitModelName(name) {
284
284
  const i = String(name).indexOf('/');