-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Somewhat hacky method to add applicationPeriod.end 2 hours later #278
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -9,8 +9,17 @@ const DatePickerInput = (props: Props) => { | |||
const [toDate, setToDate] = useState(""); | |||
|
|||
useEffect(() => { | |||
const startDate = fromDate ? `${fromDate}T00:00` : ""; | |||
const endDate = toDate ? `${toDate}T23:59` : ""; | |||
const startDate = fromDate ? `${fromDate}T02:00` : ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hvorfor 2 på natta på startDate?
let endDate = toDate ? `${toDate}T00:00` : ""; | ||
|
||
if (endDate) { | ||
const endDateObj = new Date(endDate); | ||
endDateObj.setDate(endDateObj.getDate() + 2); | ||
endDateObj.setHours(endDateObj.getHours() - 22); | ||
endDate = endDateObj.toISOString(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trenger vi alt dette? kan vi ikke bare bruke endDate
og sette dagen til +1?
noe sånn:
let endDate = toDate ? `${toDate}T00:00` : ""; | |
if (endDate) { | |
const endDateObj = new Date(endDate); | |
endDateObj.setDate(endDateObj.getDate() + 2); | |
endDateObj.setHours(endDateObj.getHours() - 22); | |
endDate = endDateObj.toISOString(); | |
} | |
constendDate = toDate ? `${toDate}T02:00` : ""; | |
if (endDate) { | |
endDate.setDate(endDateObj.getDate() + 1); | |
} |
Også bare toISOString()
på start og end date før de returneres
No description provided.