Skip to content

feat: update datetime filters issue#185

Merged
christyjacob4 merged 8 commits intomainfrom
datetime-filter-updates
Sep 13, 2022
Merged

feat: update datetime filters issue#185
christyjacob4 merged 8 commits intomainfrom
datetime-filter-updates

Conversation

@christyjacob4
Copy link
Copy Markdown
Contributor

No description provided.

@christyjacob4 christyjacob4 changed the base branch from fix-force-datetime-filter to main September 12, 2022 11:53
Comment thread src/Database/Database.php
throw new Exception('Default value ' . $default . ' does not match given type ' . $type);
}
break;
case self::VAR_DATETIME:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only check for datetime. To ensure that datetime attribute allows a default value of type string

Comment thread tests/Database/Base.php
$this->assertEquals(true, static::getDatabase()->createAttribute('attributes', 'integer_default', Database::VAR_INTEGER, 0, false, 1));
$this->assertEquals(true, static::getDatabase()->createAttribute('attributes', 'float_default', Database::VAR_FLOAT, 0, false, 1.5));
$this->assertEquals(true, static::getDatabase()->createAttribute('attributes', 'boolean_default', Database::VAR_BOOLEAN, 0, false, false));
$this->assertEquals(true, static::getDatabase()->createAttribute('attributes', 'datetime_default', Database::VAR_DATETIME, 0, false, '2000-06-12T14:12:55.000+00:00', true, false, null, [], ['datetime']));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When we create a datetime attribute, we should pass the filter explicitly..

Comment thread src/Database/Database.php Outdated
Copy link
Copy Markdown
Contributor

@TorstenDittmann TorstenDittmann left a comment

Choose a reason for hiding this comment

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

I think if we add tests for required attributes it should be good 👍🏻

@Meldiron
Copy link
Copy Markdown
Contributor

This closes #181 I believe

@christyjacob4 christyjacob4 merged commit 3118902 into main Sep 13, 2022
@abnegate abnegate deleted the datetime-filter-updates branch November 23, 2023 01:47
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.

3 participants