Skip to content

Commit

Permalink
Merge pull request #106 from Synicix/undefined_bug
Browse files Browse the repository at this point in the history
Datetime bug with dealing with undefined values
  • Loading branch information
guzman-raphael authored Mar 8, 2021
2 parents ebecafc + b2d5e8b commit bbcd0a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
- CSS for making the primary keys look disabled/readonly for update mode PR #105

### Fixed
- Fix bug of delete with datetime in primarykey crashing PR #105
- Fixed bug of delete with datetime in primarykey crashing PR #105
- Fixed issue where website crashes when opening a filter card for datetime. (#104) PR #106

## [0.1.0-beta.1] - 2021-02-26
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,13 @@ class TableAttribute {
var splitResult = [undefined, undefined]
var defaultValueSplitResult: any = ['', '']

if (currentValue !== "undefined undefined" && currentValue !== undefined) {
splitResult = currentValue.split(' ');
if (currentValue !== "undefined undefined" && currentValue !== undefined) { // Yes this is a hack for now, we will consildate this to one standard
if (Array.isArray(currentValue)) {
splitResult = currentValue;
}
else {
splitResult = currentValue.split(' ');
}
}

if (defaultValue !== undefined) {
Expand All @@ -318,7 +323,6 @@ class TableAttribute {

return(
<div className="dateTimeFields">
{/* <input type="datetime-local" value={currentValue.replace(',', ' ')} id={tableAttribute.attributeName} onChange={(e) => handleChange(e, tableAttribute.attributeName)} /> */}
<input type="date" defaultValue={defaultValueSplitResult[0]} value={splitResult[0]} id={tableAttribute.attributeName + "__date"} onChange={(e) => handleChange(e, tableAttribute.attributeName + "__date")}></input>
<input type="time" step="1" defaultValue={defaultValueSplitResult[1]} value={splitResult[1]} id={tableAttribute.attributeName + "__time"} onChange={(e) => handleChange(e, tableAttribute.attributeName + "__time")}></input>
</div>
Expand Down

0 comments on commit bbcd0a0

Please sign in to comment.