Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
4f3477ad
Commit
4f3477ad
authored
May 02, 2024
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for operations list, filter only on date instead of datetime
parent
b3184aff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ListOperationFormType.php
src/Form/Type/ListOperationFormType.php
+3
-3
OperationUtils.php
src/Utils/OperationUtils.php
+2
-2
No files found.
src/Form/Type/ListOperationFormType.php
View file @
4f3477ad
...
...
@@ -6,7 +6,7 @@ use App\Enum\MoyenEnum;
use
Doctrine\ORM\EntityManagerInterface
;
use
Symfony\Component\Form\AbstractType
;
use
Symfony\Component\Form\Extension\Core\Type\ChoiceType
;
use
Symfony\Component\Form\Extension\Core\Type\DateT
imeT
ype
;
use
Symfony\Component\Form\Extension\Core\Type\DateType
;
use
Symfony\Component\Form\Extension\Core\Type\SubmitType
;
use
Symfony\Component\Form\FormBuilderInterface
;
use
Symfony\Component\HttpFoundation\Session\SessionInterface
;
...
...
@@ -40,13 +40,13 @@ class ListOperationFormType extends AbstractType
return
MoyenEnum
::
getTypeName
(
$choice
);
},
])
->
add
(
'datemin'
,
DateT
imeT
ype
::
class
,
[
->
add
(
'datemin'
,
DateType
::
class
,
[
'label'
=>
'Date min'
,
'required'
=>
false
,
'widget'
=>
'single_text'
,
// 'data' => new \DateTime('first day of this month')
])
->
add
(
'datemax'
,
DateT
imeT
ype
::
class
,
[
->
add
(
'datemax'
,
DateType
::
class
,
[
'label'
=>
'Date max'
,
'required'
=>
false
,
'widget'
=>
'single_text'
,
...
...
src/Utils/OperationUtils.php
View file @
4f3477ad
...
...
@@ -60,13 +60,13 @@ class OperationUtils
if
(
!
empty
(
$request
->
get
(
'formListOperations'
)[
'datemin'
]))
{
$qb
->
andWhere
(
'a.createdAt >= :datemin'
)
->
setParameter
(
'datemin'
,
$request
->
get
(
'formListOperations'
)[
'datemin'
]
.
' 00:00:00'
)
->
setParameter
(
'datemin'
,
$request
->
get
(
'formListOperations'
)[
'datemin'
]
)
// Date only comparison: error in queries comparing datetimes with some MYSQL versions
;
}
if
(
!
empty
(
$request
->
get
(
'formListOperations'
)[
'datemax'
]))
{
$qb
->
andWhere
(
'a.createdAt <= :datemax'
)
->
setParameter
(
'datemax'
,
$request
->
get
(
'formListOperations'
)[
'datemax'
]
.
' 23:59:59'
)
->
setParameter
(
'datemax'
,
$request
->
get
(
'formListOperations'
)[
'datemax'
])
;
}
if
(
!
empty
(
$request
->
get
(
'formListOperations'
)[
'moyen'
]))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment