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

[FEATURE] Add ViewHelper that can display remaining participants of a period #83

Merged
merged 7 commits into from
Jun 11, 2021

Conversation

pascal20997
Copy link
Contributor

No description provided.

@pascal20997 pascal20997 added this to the v1.2 milestone Jun 9, 2021
@pascal20997 pascal20997 requested a review from froemken June 9, 2021 13:20
$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');
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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...

Copy link
Contributor Author

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.

Classes/ViewHelpers/PeriodRegistrationViewHelper.php Outdated Show resolved Hide resolved

protected function setTestTemplate(int $facilityUid, \DateTime $dateAndBegin): void
{
$this->standaloneView->setTemplateSource(
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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.

@pascal20997 pascal20997 merged commit 3e64d37 into master Jun 11, 2021
@sfroemkenjw sfroemkenjw deleted the featureDynamicButton branch November 17, 2023 07:17
sfroemkenjw pushed a commit that referenced this pull request Nov 17, 2023
[FEATURE] Add ViewHelper that can display remaining participants of a period
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.

2 participants