Skip to content

Conversation

jacob-y-pan
Copy link
Contributor

@jacob-y-pan jacob-y-pan commented Aug 2, 2022

Allow capability to edit alerts that were created through the webapp. Change from check marks / crosses to "True" / "False" to allow easy editing, and prevent editing if new values are invalid.
Changes begin at 12e1a62

BCK-7009

Jacob Pan added 3 commits July 25, 2022 20:26
Add edit from material table, including data validation for dates and
events. Events changed to True/False for easier editing purposes, and
dates were changed to align with ISO-8601 format.

BCK-7009
Dates need to also be able to be edited to empty, so enabe checking for
that and handling it accordingly.

BCK-7009
Merge with delete branch for git logging purposes.

BCK-7007
title: "Start Date (Y-M-D)", field: "start_date", validate: (rowData) => {
if (!rowData['start_date']) return true;
let holderDate = new Date(rowData['start_date']);
return holderDate instanceof Date && !isNaN(holderDate.getTime()) ? true : {isValid: false, helperText: 'Invalid Date - Must be ISO8601 parseable' };
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a better way that we can write !isNaN? Double negative is confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't instinctively think of one? - got it from this StackOverflow thread: https://stackoverflow.com/questions/1353684/detecting-an-invalid-date-date-instance-in-javascript

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