Skip to content

Commit

Permalink
fix: change session activity to use local date (#2478)
Browse files Browse the repository at this point in the history
  • Loading branch information
shineli1984 authored Dec 19, 2024
1 parent 75040ec commit 8ea903d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ const syncSendCount = () => {
sendCount = getItem(SESSION_ACTIVITY_COUNT_KEY) || {};
const sendDay = getItem(SESSION_ACTIVITY_DAY_KEY);

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

0 comments on commit 8ea903d

Please sign in to comment.