diff --git a/src/components/Form/Form.jsx b/src/components/Form/Form.jsx index d943419..2661410 100644 --- a/src/components/Form/Form.jsx +++ b/src/components/Form/Form.jsx @@ -1,10 +1,38 @@ import React from "react"; function Form() { + + // Handling submission of the form + const handleFormSubmit = (e)=>{ + e.preventDefault(); + const date = document.querySelector(".input__date").value; + const time = document.querySelector(".input__time").value; + + const dateSplitted = date.split("-") + const timeSplitted = time.split(":") + const inputDateTime = new Date(dateSplitted[0], `${Number(dateSplitted[1])-1}`, dateSplitted[2], timeSplitted[0],timeSplitted[1],0,0 ); + + const currentDateTime = new Date() + + const inputValidationDate = document.querySelector(".input__validation-date"); + const inputValidationTime = document.querySelector(".input__validation-time"); + + if(inputDateTime.getDate()
-
+ handleFormSubmit(e)}>

Find your Home Care Taker

@@ -12,7 +40,7 @@ function Form() {
@@ -37,7 +65,7 @@ function Form() {
@@ -60,30 +88,35 @@ function Form() {
- +
+ + +
+
-
+ +