diff --git a/src/album/forms/AlbumForm.tsx b/src/album/forms/AlbumForm.tsx index 3cb542e..51af910 100644 --- a/src/album/forms/AlbumForm.tsx +++ b/src/album/forms/AlbumForm.tsx @@ -120,14 +120,26 @@ const AlbumForm: React.FC = ({ albumId, reference, onSubmit }) => { ampmInClock={true} label="Date" value={values.timestamp} - onChange={date => setValues({ ...values, timestamp: date as Date })} + onChange={date => { + if (!date) { + setValues({ ...values, timestamp: date as any }); + return; + } + date.setSeconds(0); + date.setMilliseconds(0); + setValues({ ...values, timestamp: date }); + }} /> setValues({ ...values, secret: !values.secret })} + onChange={() => setValues({ + ...values, + secret: !values.secret, + release: null + })} /> } label="Is secret album" @@ -142,7 +154,8 @@ const AlbumForm: React.FC = ({ albumId, reference, onSubmit }) => { ...values, release: values.release === null ? new Date(values.timestamp.getTime() + 1000 * 60 * 60 * 24) - : null + : null, + secret: false })} />} label="Enable scheduled release"