Fix banner time for Ayaka

pull/1/head
Made Baruna 2022-05-31 19:50:49 +07:00
parent 0fc6a00d53
commit 35b60a2fa9
3 changed files with 32 additions and 30 deletions

View File

@ -376,12 +376,13 @@ export const banners = {
color: '#FFFBF7',
featured: ['kamisato_ayaka'],
featuredRare: ['sayu', 'razor', 'rosaria'],
timezoneDependentEnd: true,
},
{
name: 'Discerner of Enigmas',
image: 1,
shortName: 'Yelan',
start: '2022-05-31 06:00:00',
start: '2022-05-31 09:00:00',
end: '2022-06-21 17:59:59',
color: '#7de6fd',
featured: ['yelan', 'xiao'],
@ -711,7 +712,7 @@ export const banners = {
{
name: 'Epitome Invocation',
image: 29,
start: '2022-05-31 06:00:00',
start: '2022-05-31 09:00:00',
end: '2022-06-21 17:59:59',
shortName: 'Aqua',
color: '#eae5e1',

View File

@ -120,7 +120,7 @@ export const bannersDual = {
name: 'Discerner of Enigmas',
image: 1,
shortName: 'Yelan',
start: '2022-05-31 06:00:00',
start: '2022-05-31 09:00:00',
end: '2022-06-21 17:59:59',
color: '#7de6fd',
featured: ['yelan', 'xiao'],
@ -131,7 +131,7 @@ export const bannersDual = {
name: 'Invitation to Mundane Life',
image: 3,
shortName: 'Xiao',
start: '2022-05-31 06:00:00',
start: '2022-05-31 09:00:00',
end: '2022-06-21 17:59:59',
color: '#25d7b8',
featured: ['yelan', 'xiao'],

View File

@ -26,13 +26,10 @@
import { getAccountPrefix } from '../../stores/account';
import { fromRemote, readSave } from '../../stores/saveManager';
import { getTimeOffset, server } from '../../stores/server';
import { pushToast } from '../../stores/toast';
Chart.defaults.global.defaultFontColor = '#cbd5e0';
Chart.defaults.global.defaultFontFamily = 'Poppins';
let numberFormat = Intl.NumberFormat();
const { open: openModal } = getContext('simple-modal');
export let id;
@ -73,31 +70,34 @@
let showRarity = [true, true, true];
selectedBanners = banners[bannerType].map((e) => {
// banner data based on Asia time
const diff = e.timezoneDependent === true ? 8 - getTimeOffset() : 0;
function processBannersTime() {
selectedBanners = banners[bannerType].map((e) => {
// banner data based on Asia time
const diff = e.timezoneDependent === true ? 8 - getTimeOffset() : 0;
const diffEnd = e.timezoneDependentEnd === true ? 8 - getTimeOffset() : 0;
const id = `${e.name} ${e.image}`;
const dual = bannersDual[id] !== undefined;
const start = dayjs(e.start, 'YYYY-MM-DD HH:mm:ss').subtract(diff, 'hour');
const end = dayjs(e.end, 'YYYY-MM-DD HH:mm:ss');
const image = `/images/banners/${id}.png`;
const id = `${e.name} ${e.image}`;
const dual = bannersDual[id] !== undefined;
const start = dayjs(e.start, 'YYYY-MM-DD HH:mm:ss').subtract(diff, 'hour');
const end = dayjs(e.end, 'YYYY-MM-DD HH:mm:ss').subtract(diffEnd, 'hour');
const image = `/images/banners/${id}.png`;
return {
...e,
id,
dual,
start: start.unix(),
end: end.unix(),
image,
total: 0,
legendary: [],
rare: {
character: [],
weapon: [],
},
};
});
return {
...e,
id,
dual,
start: start.unix(),
end: end.unix(),
image,
total: 0,
legendary: [],
rare: {
character: [],
weapon: [],
},
};
});
}
function openDetail(banner, isDual) {
let secondBanner;
@ -434,6 +434,7 @@
server.set(serverSave);
}
processBannersTime();
await readLocalData();
isSafari =