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

Try to fix incorrect Date format detection #992

Closed
wants to merge 5 commits into from

Conversation

solracsf
Copy link
Member

@solracsf solracsf commented Apr 1, 2022

deleted

@solracsf
Copy link
Member Author

solracsf commented Apr 1, 2022

/backport to stable23

@solracsf
Copy link
Member Author

solracsf commented Apr 1, 2022

/backport to stable22

@ArtificialOwl
Copy link
Member

This might work on php8 with the new null safe operator, but I do not think the null coalescing operator will catch the exception of getTimestamp() on bool.

maybe ?

  $dateTime = DateTime::createFromFormat('Y-m-d H:i:s', $creation);
  $timestamp = $dateTime ? $dateTime->getTimestamp() : (int) strtotime('Y-m-d H:i:s', $creation);

@solracsf
Copy link
Member Author

solracsf commented Apr 1, 2022

It fixed on my instance, but I'm indeed on php8.
Moving to ternary operator

@codecov-commenter
Copy link

codecov-commenter commented Apr 5, 2022

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (d0fbb21) 0.69% compared to head (3b2b73e) 0.69%.

❗ Current head 3b2b73e differs from pull request most recent head cc77d6b. Consider uploading reports for the commit cc77d6b to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             master    #992      +/-   ##
===========================================
- Coverage      0.69%   0.69%   -0.01%     
- Complexity     5716    5717       +1     
===========================================
  Files           289     289              
  Lines         19764   19766       +2     
===========================================
  Hits            138     138              
- Misses        19626   19628       +2     
Impacted Files Coverage Δ
lib/Model/Circle.php 20.70% <0.00%> (-0.17%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ArtificialOwl
Copy link
Member

can you squash and signoff your commit ?

@solracsf solracsf closed this May 8, 2023
@solracsf solracsf deleted the getTimestamp-on-bool branch May 8, 2023 12:39
@solracsf solracsf removed this from the Nextcloud 27 milestone May 8, 2023
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

5 participants