Skip to content

Commit

Permalink
third attempt at fixing the date
Browse files Browse the repository at this point in the history
  • Loading branch information
sam9116 committed Feb 6, 2024
1 parent 82b71cd commit c744e5c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/PickDate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DatePicker from "react-datepicker";
import { useState } from "react"
import { useEffect, useState } from "react"
import "react-datepicker/dist/react-datepicker.css";

function PickDate({ updateStartDateInParent, updateEndDateInParent }) {
Expand All @@ -8,8 +8,9 @@ function PickDate({ updateStartDateInParent, updateEndDateInParent }) {
const oneYearFromNow = new Date(today);
oneYearFromNow.setFullYear(today.getFullYear() + 1);

const [startDate, setStartDate] = useState(today);
const [endDate, setEndDate] = useState(oneYearFromNow);
const [startDate, setStartDate] = useState(new Date());
const [endDate, setEndDate] = useState(new Date());
useEffect(()=>{setStartDate(today); setEndDate(oneYearFromNow);},[])

// Display spotify token
return (
Expand Down

0 comments on commit c744e5c

Please sign in to comment.