updated stream schedule

This commit is contained in:
liyunze 2024-11-23 16:52:29 +11:00
parent 3ee787c3c0
commit bf66861cb4

View file

@ -4,15 +4,20 @@
const myLocation = "Australia/Melbourne"; const myLocation = "Australia/Melbourne";
const myStreamSchedule = [ type StreamScheduleDay = {
{ start: moment.Moment;
start: getUpcomingTimeDevTZ(2, "9:30"), end: moment.Moment;
end: getUpcomingTimeDevTZ(2, "16:00"), };
},
{ const myStreamSchedule: null | StreamScheduleDay[] = [
start: getUpcomingTimeDevTZ(4, "9:30"), // {
end: getUpcomingTimeDevTZ(4, "16:00"), // start: getUpcomingTimeDevTZ(2, "9:30"),
}, // end: getUpcomingTimeDevTZ(2, "16:00"),
// },
// {
// start: getUpcomingTimeDevTZ(4, "9:30"),
// end: getUpcomingTimeDevTZ(4, "16:00"),
// },
]; ];
/** /**
@ -75,6 +80,9 @@
let formattedLocalisedSchedule: Schedule[] = $state([]); let formattedLocalisedSchedule: Schedule[] = $state([]);
function displayStreamSchedule() { function displayStreamSchedule() {
if (myStreamSchedule == null) {
return;
}
localisedStreamSchedule = myStreamSchedule.map((stream) => ({ localisedStreamSchedule = myStreamSchedule.map((stream) => ({
start: convertToUserLocalTimezone(stream.start), start: convertToUserLocalTimezone(stream.start),
end: convertToUserLocalTimezone(stream.end), end: convertToUserLocalTimezone(stream.end),
@ -133,6 +141,7 @@
</div> </div>
{/if} {/if}
<div class="mt-1"> <div class="mt-1">
{#if myStreamSchedule.length}
<table> <table>
<thead> <thead>
<tr> <tr>
@ -162,6 +171,15 @@
{/if} {/if}
</tbody> </tbody>
</table> </table>
{:else}
<div>
To be announced on <a
href="/discord"
target="_blank"
class="underline hover:text-blue-500">Discord</a
>
</div>
{/if}
</div> </div>
<style> <style>