-
Notifications
You must be signed in to change notification settings - Fork 3
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
[FEATURE] Add ViewHelper that can display remaining participants of a period #83
Conversation
$begin = clone $dateTime; | ||
$begin->setDate(1970, 1, 1); | ||
// $begin must be UTC because TCA saves that timestamp in UTC but others in configured timezone | ||
$begin = new \DateTime('@0'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@[timestamp] should always be the last possible option. Please have a look here: https://github.com/jweiland-net/events2/blob/master/Classes/Domain/Model/Event.php#L246-L254 Maybe that will match your needs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using this because TYPO3 saves time
timestamps in UTC (DataHandler). I could use something like new \DateTime('1970/01/01', new \DateTimeZone('UTC'))
instead but it must be UTC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have nothing against UTC, but why are you working with 01.01.1970 always? Don't get it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because of that field just saves the time
like 14:00. The real date is inside the field date
but without the time so like 2021/06/10 00:00.
Documentation/Extend reserve/PeriodRegistrationViewHelper/Index.rst
Outdated
Show resolved
Hide resolved
Documentation/Extend reserve/PeriodRegistrationViewHelper/Index.rst
Outdated
Show resolved
Hide resolved
|
||
protected function setTestTemplate(int $facilityUid, \DateTime $dateAndBegin): void | ||
{ | ||
$this->standaloneView->setTemplateSource( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO it's not your task to test a complete template. Just test the code in the ViewHelper and you're done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first thought was like calling renderStatic()
and am fine but then I thought it would be more realistic to really "use" the ViewHelper in a dummy template and render it to get the result.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case I prefer using real template files like done here: https://github.com/jweiland-net/events2/blob/master/Resources/Private/Templates/Day/ListThisWeek.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could add an example template that uses this ViewHelper in the Tests Folder or like Resources/Private/Templates/Test/ViewHelper.html
or so because I don't use the ViewHelper inside the extension templates.
[FEATURE] Add ViewHelper that can display remaining participants of a period
No description provided.