Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fredrir
Copy link
Member

@fredrir fredrir commented Aug 18, 2024

No description provided.

@fredrir fredrir linked an issue Aug 18, 2024 that may be closed by this pull request
Copy link

vercel bot commented Aug 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
online-opptak ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 18, 2024 0:07am

@jorgengaldal
Copy link
Collaborator

@julian-ao

@@ -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` : "";
Copy link
Member

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?

Comment on lines +14 to +21
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();
}
Copy link
Member

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:

Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Application period should end 02:00
3 participants