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

feat: schedule closing date #4433

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft

feat: schedule closing date #4433

wants to merge 21 commits into from

Conversation

thiessenp-cds
Copy link
Contributor

Summary | Résumé

TODO

Copy link
Contributor

@timarney timarney changed the title feat/closing-date-dialog feat: schedule closing date Oct 18, 2024
const saveFormStatus = useCallback(async () => {
let closeDate = "open";
let closeDate = "open"; // this wil reset the closing date to null;
Copy link
Member

@timarney timarney Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can pass just null vs "open" here and update the server action but we need to check of the closing date is already set in the future before we null out the date.

Originally I was passing open to avoid any potential JS type coercion with the API call --- which is now gone and replaced with a server action.

@@ -46,7 +46,17 @@ export const SetClosingDate = ({
return true;
}, [closedMessage]);

const [status, setStatus] = useState(closingDate ? "closed" : "open");
// TODO: not working, needs more work
const isPastDate = useCallback(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use the dateHasPast util func here

const isPastClosingDate = dateHasPast(Date.parse(closingDate));

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.

2 participants