mirror of
https://github.com/liyunze-coding/RythonDev.git
synced 2026-09-22 07:44:26 +00:00
hide tabs when same timezone
This commit is contained in:
parent
a736e8386a
commit
d46ab9b545
2 changed files with 35 additions and 28 deletions
|
|
@ -79,7 +79,7 @@
|
||||||
task: "chat about MBTI",
|
task: "chat about MBTI",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
streamer: "Elly78456",
|
streamer: "Ellyskey",
|
||||||
task: "sell YOUthversity merch",
|
task: "sell YOUthversity merch",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -126,10 +126,6 @@
|
||||||
streamer: "lyricalclove",
|
streamer: "lyricalclove",
|
||||||
task: "teach English",
|
task: "teach English",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
streamer: "mikewhatwhere",
|
|
||||||
task: "be a dietician",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
streamer: "msmushh",
|
streamer: "msmushh",
|
||||||
task: "vibe on stream",
|
task: "vibe on stream",
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,6 @@
|
||||||
// Current time in my timezone
|
// Current time in my timezone
|
||||||
let now = moment.tz(myLocation);
|
let now = moment.tz(myLocation);
|
||||||
|
|
||||||
// Find the upcoming Friday
|
|
||||||
let upcomingFriday = now.clone().day(5).hour(8).minute(0).second(0);
|
|
||||||
if (now.day() >= 5 && now.format("HH:mm") >= "08:00") {
|
|
||||||
// If today is Friday and it's already past 8am, set to next Friday
|
|
||||||
upcomingFriday.add(1, "week");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adjust based on the provided day and time
|
|
||||||
let dayDiff = (5 - dayOfWeek + 7) % 7; // Calculate days until Friday
|
|
||||||
let inputTime = moment(time24, "HH:mm");
|
let inputTime = moment(time24, "HH:mm");
|
||||||
let upcomingTime = now
|
let upcomingTime = now
|
||||||
.clone()
|
.clone()
|
||||||
|
|
@ -66,6 +57,8 @@
|
||||||
end: string;
|
end: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let sameTimezone = false;
|
||||||
|
|
||||||
let myStreamSchedule = [];
|
let myStreamSchedule = [];
|
||||||
let localisedStreamSchedule = [];
|
let localisedStreamSchedule = [];
|
||||||
|
|
||||||
|
|
@ -105,10 +98,20 @@
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
// Example usage
|
// Example usage
|
||||||
displayStreamSchedule();
|
displayStreamSchedule();
|
||||||
|
|
||||||
|
if (
|
||||||
|
formattedLocalisedSchedule[0].day === formattedSchedule[0].day &&
|
||||||
|
formattedLocalisedSchedule[0].start ===
|
||||||
|
formattedSchedule[0].start &&
|
||||||
|
formattedLocalisedSchedule[0].end === formattedSchedule[0].end
|
||||||
|
) {
|
||||||
|
sameTimezone = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- TABS -->
|
<!-- TABS -->
|
||||||
|
{#if !sameTimezone}
|
||||||
<div
|
<div
|
||||||
class="w-full flex
|
class="w-full flex
|
||||||
bg-[#141414]
|
bg-[#141414]
|
||||||
|
|
@ -126,9 +129,11 @@
|
||||||
on:click={() => (adjusted = false)}
|
on:click={() => (adjusted = false)}
|
||||||
class="rounded-lg flex-grow py-2
|
class="rounded-lg flex-grow py-2
|
||||||
transition-colors duration-150
|
transition-colors duration-150
|
||||||
{adjusted ? 'text-gray-400' : 'text-white bg-[#303030]'}">AEDT</button
|
{adjusted ? 'text-gray-400' : 'text-white bg-[#303030]'}"
|
||||||
|
>AEST/<wbr />AEDT</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -155,3 +160,9 @@
|
||||||
{/if}
|
{/if}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
tr {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue