Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
dfa2d931
Commit
dfa2d931
authored
Nov 11, 2021
by
Dominik Hebeler
Browse files
Merge branch '1158-modify-date-filter' into 'development'
Resolve "Modify Date Filter" Closes
#1158
See merge request
!1925
parents
63d2944d
2a9ff722
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
app/MetaGer.php
View file @
dfa2d931
...
...
@@ -1094,6 +1094,19 @@ class MetaGer
$from
=
$tmp
;
$changed
=
true
;
}
# Bing only allows a maximum of 1 year in the past
# Verify the parameters
$yearAgo
=
Carbon
::
now
()
->
subYear
();
if
(
$from
<
$yearAgo
)
{
$from
=
clone
$yearAgo
;
$changed
=
true
;
}
if
(
$to
<
$yearAgo
)
{
$to
=
clone
$yearAgo
;
$changed
=
true
;
}
if
(
$changed
)
{
$oldParameters
=
$this
->
request
->
all
();
$oldParameters
[
"ff"
]
=
$from
->
format
(
"Y-m-d"
);
...
...
resources/views/parts/custom-daterange.blade.php
View file @
dfa2d931
<div
id=
"bing-from-to"
>
<input
type=
"date"
form=
"searchForm"
@
if
(
Request::filled
("
ff
"))
value=
"{{ Request::input("
ff
",
"")
}}"
@
endif
name=
"ff"
onchange=
"if(document.querySelector('input[name=ff]').value != '' && document.querySelector('input[name=ft]').value != ''){this.form.submit();}"
>
<input
type=
"date"
min=
"{{ Carbon::now()->subYear()->format("
Y-m-d
")
}}"
max=
"{{ Carbon::now()->format("
Y-m-d
")
}}"
form=
"searchForm"
@
if
(
Request::filled
("
ff
"))
value=
"{{ Request::input("
ff
",
"")
}}"
@
endif
name=
"ff"
onchange=
"if(document.querySelector('input[name=ff]').value != '' && document.querySelector('input[name=ft]').value != ''){this.form.submit();}"
>
<div>
-
</div>
<input
type=
"date"
form=
"searchForm"
@
if
(
Request::filled
("
ft
"))
value=
"{{ Request::input("
ft
",
"")
}}"
@
endif
name=
"ft"
onchange=
"if(document.querySelector('input[name=ff]').value != '' && document.querySelector('input[name=ft]').value != ''){this.form.submit();}"
>
<input
type=
"date"
min=
"{{ Carbon::now()->subYear()->format("
Y-m-d
")
}}"
max=
"{{ Carbon::now()->format("
Y-m-d
")
}}"
form=
"searchForm"
@
if
(
Request::filled
("
ft
"))
value=
"{{ Request::input("
ft
",
"")
}}"
@
endif
name=
"ft"
onchange=
"if(document.querySelector('input[name=ff]').value != '' && document.querySelector('input[name=ft]').value != ''){this.form.submit();}"
>
</div>
\ No newline at end of file
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