diff --git a/jobboard-sanity/schemaTypes/job.js b/jobboard-sanity/schemaTypes/job.js index c535bd5..a901ee9 100644 --- a/jobboard-sanity/schemaTypes/job.js +++ b/jobboard-sanity/schemaTypes/job.js @@ -17,6 +17,14 @@ export default { maxLength: 96, }, }, + { + name: "postedDate", + title: "Date Posted", + type: "date", + options: { + dateFormat: "YYYY-MM-DD", + }, + }, { name: 'summary', title: 'Summary', diff --git a/src/pages/Apply.jsx b/src/pages/Apply.jsx index 211c45a..3a7ecea 100644 --- a/src/pages/Apply.jsx +++ b/src/pages/Apply.jsx @@ -1,5 +1,5 @@ -import { useParams } from "react-router-dom"; -import { useState } from "react"; +import { useParams, Link } from "react-router-dom"; +import { useState, useEffect } from "react"; import PhoneInput from "react-phone-input-2"; import "react-phone-input-2/lib/style.css"; import { createClient } from '@supabase/supabase-js' @@ -22,6 +22,12 @@ const Apply = () => { resume: null, }); + const [jobTitle, setJobTitle] = useState(""); + + useEffect(() => { + setJobTitle(slug.replace(/-/g, " ")); + }, [slug]); + const requirePermitExpiry = ["Work Permit", "Study Permit"].includes(formData.immigrationStatus); const handleChange = (e) => { @@ -80,8 +86,21 @@ const Apply = () => { }; return ( -
Date Posted: {new Date(job.postedDate).toDateString()}
+ )} +