Fix month from now calculation

This commit is contained in:
abefernan
2023-06-05 08:13:11 +02:00
parent c98f6180dc
commit 16f8dfeeb9
@@ -16,9 +16,10 @@ import StackableContainer from "../../../layout/StackableContainer";
Matching the crazy datetime-local input format
*/
const getMinEndTime = (): string => {
const minDate = new Date();
const minTimestamp = Date.now() + 1000 * 60 * 60 * 24 * 30;
const minDate = new Date(minTimestamp);
const minMonth = minDate.getMonth() + 1 + 1; // It's 0-indexed and we want next month
const minMonth = minDate.getMonth() + 1; // It's 0-indexed
const minMonthStr = minMonth < 10 ? `0${minMonth}` : String(minMonth);
const minDay = minDate.getDate();