Compare commits
No commits in common. "023a5075c2143ceb2cf2cdf8def15e6ecb146c1d" and "66212c3c2787d65db7c8fea826a65ca246a7f647" have entirely different histories.
023a5075c2
...
66212c3c27
1 changed files with 3 additions and 29 deletions
|
|
@ -23,30 +23,6 @@
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isRegistrationOpen() {
|
||||
if (!data.register_startDate) return false;
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
const startDate = data.register_startDate;
|
||||
const endDate = data.register_endDate;
|
||||
|
||||
if (endDate) {
|
||||
return today >= startDate && today <= endDate;
|
||||
}
|
||||
return today >= startDate;
|
||||
}
|
||||
|
||||
function isRegistrationExpired() {
|
||||
if (!data.register_endDate) return false;
|
||||
const today = new Date().toISOString().slice(0, 10);
|
||||
return today > data.register_endDate;
|
||||
}
|
||||
|
||||
function getRegistrationText() {
|
||||
if (isRegistrationExpired()) return 'ดาวน์โหลดใบสมัคร';
|
||||
if (isRegistrationOpen()) return 'ใบสมัคร';
|
||||
return 'สมัครสอบ';
|
||||
}
|
||||
</script>
|
||||
|
||||
<section>
|
||||
|
|
@ -120,9 +96,7 @@
|
|||
{/each}
|
||||
{/if}
|
||||
{#if data.announcementExam && data.positions}
|
||||
<div class="w-12/12 text-lg font-medium pt-6">
|
||||
{getRegistrationText()}
|
||||
</div>
|
||||
<div class="w-12/12 text-lg font-medium pt-6">ใบสมัคร</div>
|
||||
|
||||
<hr class="border-blueGray-200 my-2" />
|
||||
<div class="grid grid-cols-2 justify-stretch ... gap-4">
|
||||
|
|
@ -148,7 +122,7 @@
|
|||
target="_blank"
|
||||
>
|
||||
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
||||
{isRegistrationOpen() || isRegistrationExpired() ? 'ใบสมัคร' : ''}
|
||||
ใบสมัคร
|
||||
</a>
|
||||
{/if}
|
||||
<div class="pl-2">
|
||||
|
|
@ -182,7 +156,7 @@
|
|||
target="_blank"
|
||||
>
|
||||
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
||||
{isRegistrationOpen() || isRegistrationExpired() ? 'ใบสมัคร' : ''}
|
||||
ใบสมัคร
|
||||
</a>
|
||||
{/if}
|
||||
<div class="pl-2">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue