diff options
| author | zephex-alt <[email protected]> | 2024-04-30 04:08:49 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-30 04:08:49 +0000 |
| commit | b9059d978d2b86e15aa7c3846ef71fc62f711486 (patch) | |
| tree | 0833f1e05968f8f42ad2e736605af734e6bab30d /src/app/anime/history | |
| parent | late night fuckery (diff) | |
| download | dramalama-b9059d978d2b86e15aa7c3846ef71fc62f711486.tar.xz dramalama-b9059d978d2b86e15aa7c3846ef71fc62f711486.zip | |
small fixes
Diffstat (limited to 'src/app/anime/history')
| -rw-r--r-- | src/app/anime/history/continueWatching/cw.module.css | 2 | ||||
| -rw-r--r-- | src/app/anime/history/continueWatching/page.jsx | 2 | ||||
| -rw-r--r-- | src/app/anime/history/storeData.js | 9 |
3 files changed, 11 insertions, 2 deletions
diff --git a/src/app/anime/history/continueWatching/cw.module.css b/src/app/anime/history/continueWatching/cw.module.css index e473513..ce70c30 100644 --- a/src/app/anime/history/continueWatching/cw.module.css +++ b/src/app/anime/history/continueWatching/cw.module.css @@ -58,4 +58,4 @@ .animeEntry img {
width: 35%;
}
-}
\ No newline at end of file +}
diff --git a/src/app/anime/history/continueWatching/page.jsx b/src/app/anime/history/continueWatching/page.jsx index d9bc6d1..4b18adf 100644 --- a/src/app/anime/history/continueWatching/page.jsx +++ b/src/app/anime/history/continueWatching/page.jsx @@ -43,7 +43,7 @@ const ContinueWatching = () => { </p>
<p className={styles.date}>
Last watched on: {item.date} at{" "}
- {item.time}
+ {item.time} hours
</p>
</div>
<Image
diff --git a/src/app/anime/history/storeData.js b/src/app/anime/history/storeData.js index b748d3b..4008095 100644 --- a/src/app/anime/history/storeData.js +++ b/src/app/anime/history/storeData.js @@ -1,6 +1,7 @@ "use client";
export function storeLocal(watchData) {
+ const currentDate = new Date();
const jsonData = localStorage.getItem("data");
const dataObject = jsonData ? JSON.parse(jsonData) : {};
@@ -12,7 +13,15 @@ export function storeLocal(watchData) { dataObject.watchHis.forEach((element) => {
if (element.name === watchData.name) {
let episode = watchData.episode;
+ let date = `${currentDate.getDate()}-${String(
+ currentDate.getMonth() + 1
+ ).padStart(2, "0")}`;
+ let time = `${currentDate.getHours()}:${String(
+ currentDate.getMinutes()
+ ).padStart(2, "0")}`;
element.episode = episode;
+ element.date = date;
+ element.time = time;
found = true;
}
});
|