-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixing the forum date extract logic (#482)
- Loading branch information
1 parent
9d69e68
commit 905f971
Showing
6 changed files
with
53 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { getCurrentDateInJST } from "./getDate"; | ||
import { getCurrentDateInUTC } from "./getDate"; | ||
|
||
export const storeDate = () => { | ||
const storedDateInJST = localStorage.getItem("lastCheckedDateJST"); | ||
const currentDateInJST = getCurrentDateInJST(); | ||
const storedDateInUTC = localStorage.getItem("lastCheckedDateUTC"); | ||
const currentDateInUTC = getCurrentDateInUTC(); | ||
|
||
if (!storedDateInJST) { | ||
if (!storedDateInUTC) { | ||
// If there's no stored date, set the current date to local storage. | ||
localStorage.setItem("lastCheckedDateJST", currentDateInJST); | ||
} else if (storedDateInJST !== currentDateInJST) { | ||
localStorage.setItem("lastCheckedDateUTC", currentDateInUTC); | ||
} else if (storedDateInUTC !== currentDateInUTC) { | ||
// If the stored date and the current date are different, update the stored date. | ||
localStorage.setItem("lastCheckedDateJST", currentDateInJST); | ||
localStorage.setItem("lastCheckedDateUTC", currentDateInUTC); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters