Skip to content

Commit 8ea903d

Browse files
authored
fix: change session activity to use local date (#2478)
1 parent 75040ec commit 8ea903d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/passport/sdk/src/zkEvm/sessionActivity/sessionActivity.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ const syncSendCount = () => {
1919
sendCount = getItem(SESSION_ACTIVITY_COUNT_KEY) || {};
2020
const sendDay = getItem(SESSION_ACTIVITY_DAY_KEY);
2121

22-
// If no day, set count to zero. If not today, reset sendCount to 0
23-
const today = new Date().toISOString().split('T')[0];
22+
// If no day, init sendCount. If not today, reset sendCount
23+
const date = new Date();
24+
const yyyy = date.getFullYear();
25+
const mm = `${date.getMonth() + 1}`.padStart(2, '0');
26+
const dd = `${date.getDate()}`.padStart(2, '0');
27+
const today = `${yyyy}-${mm}-${dd}`;
2428
if (!sendDay || sendDay !== today) {
2529
sendCount = {};
2630
}

0 commit comments

Comments
 (0)