mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-28 17:56:37 +02:00
Revert legacy poll date formatting
This commit is contained in:
parent
a6e39cc2c3
commit
e830d0b0f4
2 changed files with 3 additions and 2 deletions
|
@ -82,7 +82,7 @@ export default async function handler(
|
||||||
const date = legacyPoll.dates[i].toISOString();
|
const date = legacyPoll.dates[i].toISOString();
|
||||||
newOptions.push({
|
newOptions.push({
|
||||||
id: await nanoid(),
|
id: await nanoid(),
|
||||||
value: date.substring(0, date.indexOf("T")), // remove time
|
value: date,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,8 @@ export const decodeDateOption = (
|
||||||
}
|
}
|
||||||
|
|
||||||
// we add the time because otherwise Date will assume UTC time which might change the day for some time zones
|
// we add the time because otherwise Date will assume UTC time which might change the day for some time zones
|
||||||
const date = new Date(option + "T00:00:00");
|
const dateString = option.indexOf("T") === -1 ? option + "T00:00:00" : option;
|
||||||
|
const date = new Date(dateString);
|
||||||
return {
|
return {
|
||||||
type: "date",
|
type: "date",
|
||||||
day: format(date, "dd"),
|
day: format(date, "dd"),
|
||||||
|
|
Loading…
Add table
Reference in a new issue