fixing date not changing everyday

This commit is contained in:
Chris Cochrun 2022-12-13 10:15:09 -06:00
parent 058ea89df7
commit aad9d95d8a

View file

@ -26,21 +26,48 @@
return Math.abs(age_dt.getUTCFullYear() - 1970);
}
function process() {
var covered = document.getElementById("medical-coverage").checked;
console.log(covered);
if (covered) {
document.getElementById('policy').hidden = false;
console.log(document.getElementById('policy'))
console.log("WOOHOO");
}
else {
document.getElementById('policy').hidden = true;
console.log(document.getElementById('policy'))
console.log("NEGATORY");
}
function process() {
var covered = document.getElementById("medical-coverage").checked;
console.log(covered);
if (covered) {
document.getElementById('policy').hidden = false;
console.log(document.getElementById('policy'))
console.log("WOOHOO");
}
else {
document.getElementById('policy').hidden = true;
console.log(document.getElementById('policy'))
console.log("NEGATORY");
}
}
document.addEventListener('DOMContentLoaded', process);
document.addEventListener('DOMContentLoaded', process);
function dated() {
function nth(d) {
if ( d > 3 && d < 21 )
return 'th';
switch (d % 10) {
case 1: return "st";
case 2: return "nd";
case 3: return "rd";
default: return "th";
};
};
const dateObj = new Date();
const date = dateObj.getDate();
const month = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][dateObj.getMonth()];
const year = dateObj.getFullYear();
let dateString = date+nth(date)+' day of '+month+' '+year;
document.getElementById("current_date").innerHTML = dateString;
};
document.addEventListener('DOMContentLoaded', dated);
</script>
<div id="health-form" class="form text-lg w-full">
@ -157,7 +184,7 @@
<div class="basis-full flex flex-wrap items-center">
<h3 class="basis-full">Please read and agree to the following</h3>
<li>On this {{ now.Format "2" }}{{ if in (slice 1 21 31) now.Day}}st{{ else if in (slice 2 22) now.Day}}nd{{ else if in (slice 3 23) now.Day}}rd{{ else }}th{{ end }} day of {{ now.Format "January 2006" }}, I/we the parent(s)/legal guardian(s) of the above-named child ("Participant") do hereby delegate to the TFC Connection Staff a "Power of Attorney" for the above-named child for the purpose of having custody of my/our child and my/our consent to any needed emergency/medical treatment of my/our child.
<li>On this <span id="current_date"></span>, I/we the parent(s)/legal guardian(s) of the above-named child ("Participant") do hereby delegate to the TFC Connection Staff a "Power of Attorney" for the above-named child for the purpose of having custody of my/our child and my/our consent to any needed emergency/medical treatment of my/our child.
<li>In the event that I cannot be reached in an emergency during the dates specified on this form, I hereby give my permission to the physician or dentist selected by the TFC Connection Staff to hospitalize, to secure proper treatment, and/or order any injection, anesthesia, or surgery for my son or daughter as deemed necessary.
<li>I understand that every activity sponsored by TFC Connection is carefully planned and adequately supervised by mature adults. However, even with the best planning and precaution, unforeseen events can occur. By signing this form as parent/guardian, I/we agree to assume and accept all risks and hazards inherent in ministry-related activities and events. I/we acknowledge that participation in TFC Connection ministry activities and events involves risk to the participant (and to the participant's parents or guardians, if the participant is a minor), and may result in various types of injury including, but not limited to, the following: sickness, exposure to infectious/communicable disease, bodily injury, death, emotional injury, personal injury, property damage, and financial damage.
<li>In consideration for the opportunity to participate in TFC Connection activities and events, the participant (or parent/guardian if the participant is a minor) acknowledges and accepts the risks of injury associated with participation in and transportation to and from the activities or events. The participant (or parent/guardian) accepts personal financial responsibility for any injury or other loss sustained during the activity or event, or during transportation to and from the activity or event, as well as for any medical treatment rendered to the participant that is authorized by the sponsor or its agents, employees, volunteers, or any other representatives (collectively referred to as the "activity sponsor"). Further, the participant (or parent/guardian) releases and promises to indemnify, defend, and hold harmless the activity sponsor for any injury arising directly or indirectly out of ministry activities and events, or transportation to and from activities and events, whether such injury arises out of the negligence of the activity sponsor, the participant, or otherwise.