Forgot to convert the time

This commit is contained in:
Made Baruna 2021-05-19 14:16:52 +08:00
parent 3853cf9e11
commit 17fb18763a
No known key found for this signature in database
GPG key ID: 5AA5DA16AA5DCEAD

View file

@ -175,6 +175,14 @@
isEdit = false;
}
function convertTime(data) {
for (const pull of data.pulls) {
pull.time = dayjs.unix(pull.time).format('YYYY-MM-DD HH:mm:ss');
}
return data;
}
export async function readLocalData() {
console.log('wish read local');
const prefix = getAccountPrefix();
@ -183,8 +191,8 @@
if (data !== null) {
let counterData = data;
if (typeof data === 'string') {
counterData = JSON.parse(data);
await updateSave(`${prefix}${path}`, JSON.parse(data), true);
const converted = convertTime(JSON.parse(data));
await updateSave(`${prefix}${path}`, converted, true);
}
total = counterData.total;