Open
Conversation
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
maryryang2
reviewed
Aug 5, 2022
| 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' }; |
Contributor
There was a problem hiding this comment.
Is there a better way that we can write !isNaN? Double negative is confusing
Contributor
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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