@xuda.io/account_module 1.2.2180 → 1.2.2182
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/index.mjs +3 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3393,10 +3393,10 @@ export const get_account_ai_usage = async function (req, job_id, headers) {
|
|
|
3393
3393
|
// const timestamp_to = new Date(Number(year_to) || year, (Number(month_to) || month) - 1, Number(day_to) || day).getTime();
|
|
3394
3394
|
|
|
3395
3395
|
// BEGINNING OF DAY (00:00:00.000)
|
|
3396
|
-
const timestamp_from = new Date(Number(year_from)
|
|
3396
|
+
const timestamp_from = new Date(Number(year_from), Number(month_from) - 1, Number(day_from)).setHours(0, 0, 0, 0);
|
|
3397
3397
|
|
|
3398
3398
|
// END OF DAY (23:59:59.999)
|
|
3399
|
-
const timestamp_to = new Date(Number(year_to)
|
|
3399
|
+
const timestamp_to = new Date(Number(year_to), Number(month_to) - 1, Number(day_to)).setHours(23, 59, 59, 999);
|
|
3400
3400
|
|
|
3401
3401
|
const query = {
|
|
3402
3402
|
// include_docs: true,
|
|
@@ -3418,7 +3418,7 @@ export const get_account_ai_usage = async function (req, job_id, headers) {
|
|
|
3418
3418
|
reduce: true,
|
|
3419
3419
|
group_level: 999,
|
|
3420
3420
|
});
|
|
3421
|
-
|
|
3421
|
+
debugger;
|
|
3422
3422
|
let credits_obj = {},
|
|
3423
3423
|
total_credits = 0;
|
|
3424
3424
|
for (const row of ai_credits.data.rows) {
|