Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 50s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 50s
This commit is contained in:
commit
023a5075c2
1 changed files with 29 additions and 3 deletions
|
|
@ -23,6 +23,30 @@
|
|||
}
|
||||
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>
|
||||
|
|
@ -96,7 +120,9 @@
|
|||
{/each}
|
||||
{/if}
|
||||
{#if data.announcementExam && data.positions}
|
||||
<div class="w-12/12 text-lg font-medium pt-6">ใบสมัคร</div>
|
||||
<div class="w-12/12 text-lg font-medium pt-6">
|
||||
{getRegistrationText()}
|
||||
</div>
|
||||
|
||||
<hr class="border-blueGray-200 my-2" />
|
||||
<div class="grid grid-cols-2 justify-stretch ... gap-4">
|
||||
|
|
@ -122,7 +148,7 @@
|
|||
target="_blank"
|
||||
>
|
||||
<i class="fa-solid fa-pen-to-square text-sm pr-2" />
|
||||
ใบสมัคร
|
||||
{isRegistrationOpen() || isRegistrationExpired() ? 'ใบสมัคร' : ''}
|
||||
</a>
|
||||
{/if}
|
||||
<div class="pl-2">
|
||||
|
|
@ -156,7 +182,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