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

[Grid] Introduced grid datetime field type #4789

Merged
merged 1 commit into from
Apr 20, 2016

Conversation

Zales0123
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets
License MIT

It could be useful for fields like createdAt etc.

{
/** @var \DateTime $value */
$value = $this->dataExtractor->get($field, $data);
if (null === $value) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we validate if $value is instance of \DateTime?

I would add Assert::isInstanceOf($value, \DateTime::class)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure! I didn't add it, because I wasn't sure where we are now with fields validation... it would be good to validate format variable to be proper datetime format 😄 but for now - validation of value type 👍

@liverbool
Copy link
Contributor

I thinks datetime should be intl/localizeddate with dateformat,timeformat.

@pjedrzejewski pjedrzejewski merged commit c3b330c into Sylius:master Apr 20, 2016
@pjedrzejewski
Copy link
Member

Thank you Mateusz!

@liverbool Absolutely, we will add that in future PRs. ;)

@Zales0123 Zales0123 deleted the datetime-field-type branch October 28, 2016 13:39
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.

None yet

4 participants