parent
e1c6b198d2
commit
5ed68715f3
|
@ -54,7 +54,7 @@ export const eventsData = [
|
|||
end: '2021-04-23 04:00:00',
|
||||
color: '#93E05A',
|
||||
zoom: '170%',
|
||||
url: 'https://genshin.mihoyo.com/en/news/detail/9741',
|
||||
url: 'https://www.hoyolab.com/genshin/article/295568',
|
||||
showOnHome: true,
|
||||
},
|
||||
],
|
||||
|
|
|
@ -5,12 +5,13 @@
|
|||
import { onMount } from 'svelte';
|
||||
|
||||
export let event;
|
||||
export let timeDifference;
|
||||
|
||||
let now = dayjs();
|
||||
let now = dayjs().add(timeDifference, 'minute');
|
||||
|
||||
onMount(() => {
|
||||
const interval = setInterval(() => {
|
||||
now = dayjs();
|
||||
now = dayjs().add(timeDifference, 'minute');
|
||||
}, 1000);
|
||||
|
||||
return () => {
|
||||
|
|
|
@ -15,19 +15,6 @@
|
|||
|
||||
const { open: openModal } = getContext('simple-modal');
|
||||
|
||||
function openDetail(event) {
|
||||
openModal(
|
||||
DetailModal,
|
||||
{
|
||||
event,
|
||||
},
|
||||
{
|
||||
closeButton: false,
|
||||
styleWindow: { background: '#25294A', width: '600px' },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
let loading = true;
|
||||
|
||||
let timelineContainer;
|
||||
|
@ -50,6 +37,20 @@
|
|||
let events = [];
|
||||
let today = dayjs();
|
||||
|
||||
function openDetail(event) {
|
||||
openModal(
|
||||
DetailModal,
|
||||
{
|
||||
event,
|
||||
timeDifference,
|
||||
},
|
||||
{
|
||||
closeButton: false,
|
||||
styleWindow: { background: '#25294A', width: '600px' },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
function convertToDate(e, i) {
|
||||
const start = dayjs(e.start, 'YYYY-MM-DD HH:mm:ss').subtract(timeDifferenceEvent, 'minute');
|
||||
const end = dayjs(e.end, 'YYYY-MM-DD HH:mm:ss').subtract(timeDifferenceEvent, 'minute');
|
||||
|
|
Loading…
Reference in New Issue