diff --git a/src/components/EditReminder/Username.tsx b/src/components/EditReminder/Username.tsx
index bdfe3f4..cec93cf 100644
--- a/src/components/EditReminder/Username.tsx
+++ b/src/components/EditReminder/Username.tsx
@@ -1,12 +1,17 @@
-export const Username = ({ value }) => (
-
-);
+export const Username = ({ value, onChange }) => {
+ return (
+
+ );
+};
diff --git a/src/components/EditReminder/index.tsx b/src/components/EditReminder/index.tsx
index 32ecef9..6f4dfc9 100644
--- a/src/components/EditReminder/index.tsx
+++ b/src/components/EditReminder/index.tsx
@@ -9,13 +9,15 @@ import { ChannelSelector } from "./ChannelSelector";
import { useState } from "preact/hooks";
import { IntervalSelector } from "./IntervalSelector";
import { Embed } from "./Embed";
+import { DateTime } from "luxon";
type Props = {
reminder: Reminder;
};
-export const EditReminder = ({ reminder }: Props) => {
+export const EditReminder = ({ reminder: initialReminder }: Props) => {
const { guild } = useParams();
+ const [reminder, setReminder] = useState(initialReminder);
const [
{ isSuccess: channelsFetched, data: guildChannels },
@@ -75,9 +77,25 @@ export const EditReminder = ({ reminder }: Props) => {
@@ -101,7 +119,17 @@ export const EditReminder = ({ reminder }: Props) => {
type="datetime-local"
step="1"
name="time"
- value={reminder.utc_time.toFormat("yyyy-LL-dd'T'HH:mm:ss")}
+ value={reminder.utc_time
+ .toLocal()
+ .toFormat("yyyy-LL-dd'T'HH:mm:ss")}
+ onChange={(ev) => {
+ setReminder((reminder) => ({
+ ...reminder,
+ utc_time: DateTime.fromISO(
+ ev.currentTarget.value,
+ ).toUTC(),
+ }));
+ }}
>