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

EZP-30263: User date format don't apply to date fields in content item update and preview #26

Merged
merged 8 commits into from
Mar 28, 2019

Conversation

pawbuj
Copy link
Contributor

@pawbuj pawbuj commented Mar 18, 2019

Question Answer
Tickets EZP-30263
Bug fix? yes
New feature? yes
BC breaks? no
Tests pass? yes
Doc needed? yes
License GPL-2.0

Adds more date and time filters to twig

Warning, it is just one part, will be another pull request to admin-ui

Checklist:

  • Implement tests
  • Coding standards ($ composer fix-cs)

ezplatform.user.settings.short_time_format.formatter:
lazy: true
factory: 'EzSystems\EzPlatformUser\UserSetting\DateTimeFormat\ShortDateFormatterFactory:getFormatter'
class: 'EzSystems\EzPlatformUser\UserSetting\DateTimeFormat\Formatter'
Copy link
Contributor

Choose a reason for hiding this comment

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

missing empty line at the end of the file

}

return $this->fullDateTimeFormatter->format($date);
return $formatter->format($date);
Copy link
Contributor

Choose a reason for hiding this comment

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

$date is used as an argument in the format() method. We should probably check if it is instanceof DateTime. We can not pass here for example string.

Copy link
Contributor

@webhdx webhdx left a comment

Choose a reason for hiding this comment

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

It's okay but level of granulation here is little overwhelming. I think single Formatter with different methods would be enough given all classes have the same dependencies. This also applies to Factories.

Copy link

@m-tyrala m-tyrala left a comment

Choose a reason for hiding this comment

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

QA approved

@lserwatka lserwatka merged commit 23659e2 into master Mar 28, 2019
@lserwatka lserwatka deleted the EZP-30263 branch March 28, 2019 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

6 participants