@aiusage/cli 1.4.0 → 1.4.1

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/dist/cli.js +6 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2961,12 +2961,15 @@ function parseArgs(args) {
2961
2961
  }
2962
2962
  return { flags, positionals };
2963
2963
  }
2964
+ function localDateKey(d) {
2965
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
2966
+ }
2964
2967
  function getYesterdayDate() {
2965
2968
  let yesterday = /* @__PURE__ */ new Date();
2966
- return yesterday.setDate(yesterday.getDate() - 1), yesterday.toISOString().split("T")[0];
2969
+ return yesterday.setDate(yesterday.getDate() - 1), localDateKey(yesterday);
2967
2970
  }
2968
2971
  function getTodayDate() {
2969
- return (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
2972
+ return localDateKey(/* @__PURE__ */ new Date());
2970
2973
  }
2971
2974
  function buildDateRange(from, to) {
2972
2975
  let start = /* @__PURE__ */ new Date(from + "T00:00:00"), end = /* @__PURE__ */ new Date(to + "T00:00:00");
@@ -2984,7 +2987,7 @@ function getClosedDates(lookbackDays) {
2984
2987
  let dates = [];
2985
2988
  for (let offset = lookbackDays; offset >= 1; offset -= 1) {
2986
2989
  let day = /* @__PURE__ */ new Date();
2987
- day.setDate(day.getDate() - offset), dates.push(day.toISOString().split("T")[0]);
2990
+ day.setDate(day.getDate() - offset), dates.push(localDateKey(day));
2988
2991
  }
2989
2992
  return dates;
2990
2993
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiusage/cli",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Track and sync AI tool token usage across devices.",
5
5
  "license": "MIT",
6
6
  "private": false,