I am on the timezone "Europe/Paris", and I have a form with "BirthDayType". I got a problem. When an user select a date ( for example 16/10/1996), on some user (not all), the day is set after the form submission to (15/10/1996). From log I see that the date my controller received is 15/10/1996:23:00:00. It ..
I run a CLI Symfony command that works on last month transactions. I can’t think of a way to test it with Behat. Following scenario works but won’t work in December: Scenario: Do something with last month transactions Given there is a transaction "7ccf7387-d45b-4aab-ba52-f25357e4cf75" for 2020-10 And there is a transaction "39d7f278-0687-4ded-a283-4263e81ec09e" for 2020-10 When ..
I wrote a method within Doctrine to prevent overlapping of new dates that I want to add. I have startDate and endDate there: |———————|——————| | startDate | endDate | |———————|——————| | 07-11-2020 | 13-11-2020 | |———————|——————| | 14-11-2020 | 21-11-2020 | |———————|——————| When I input 4-11 to 15-11 / Exception is thrown as it should ..
I have wrote a form in my Symfony project so it can return all results for given data range. I think problem is within the form as my query builder method works as it should. When I input from 10.1 to 10.7 it returns till 10.6 not an input from last day (23:59:59). $start = ..
My goal is to output records to an excel sheet from dates between the 20th last month and the 20th this month. The records are worked hours of a user. My query to get the dates: //get user $user = $this->getUser(); //get hours between 20 last month and 20 this month $hours = $this->getDoctrine()->getRepository(Hours::class)->findUserHours($user, $start20, ..
I want to get days difference between endDate and startDate of an object : $totaldays = ($booking->getEndDate()->diff($booking->getStartDate()) + 1) return $this->render(‘test.html.twig’,[ ‘dayDiff’ => $dayDiff, ]); this return an error : Notice: Object of class DateTime could not be converted to int Source: Symfony..
I am building an api in Symphony 5 with ApiPlatform and i’m not able to get the date property through the api for the comments entity subresource. I get publishedAt when I get all the comments but it doesn’t work if I get the comments for one specific post. I included publishedAt to the same ..
I took a PHP function allowing to compare two dates and tell their difference in seconds, minutes, hours, days etc like: “5 minutes ago”, “5 years ago”, etc The problem is that each time an hour is missing on the departure date. Living in France, the DateTimeZone is “Europe / Paris”. I have this function: ..