Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
40acf3ca
Commit
40acf3ca
authored
4 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
Revert "
#1847
Fix datepicker to respect the searchDate offsets"
The intent is to refix-better in the rc This reverts commit
4c69df35
.
parent
5fab6f2d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Core/Form.php
+4
-24
4 additions, 24 deletions
CRM/Core/Form.php
with
4 additions
and
24 deletions
CRM/Core/Form.php
+
4
−
24
View file @
40acf3ca
...
...
@@ -359,8 +359,6 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
*
* @return HTML_QuickForm_Element
* Could be an error object
*
* @throws \CRM_Core_Exception
*/
public
function
&
add
(
$type
,
$name
,
$label
=
''
,
...
...
@@ -387,34 +385,16 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
unset
(
$attributes
[
'multiple'
]);
$extra
=
NULL
;
}
// @see https://docs.civicrm.org/dev/en/latest/framework/ui/#date-picker
if
(
$type
===
'datepicker'
)
{
$attributes
=
$attributes
?:
[];
if
(
!
empty
(
$attributes
[
'format'
]))
{
$dateAttributes
=
CRM_Core_SelectValues
::
date
(
$attributes
[
'format'
],
NULL
,
NULL
,
NULL
,
'Input'
);
if
(
empty
(
$extra
[
'minDate'
])
&&
!
empty
(
$dateAttributes
[
'minYear'
]))
{
$extra
[
'minDate'
]
=
$dateAttributes
[
'minYear'
]
.
'-01-01'
;
}
if
(
empty
(
$extra
[
'maxDate'
])
&&
!
empty
(
$dateAttributes
[
'minYear'
]))
{
$extra
[
'maxDate'
]
=
$dateAttributes
[
'maxYear'
]
.
'-12-31'
;
}
}
// Support minDate/maxDate properties
if
(
isset
(
$extra
[
'minDate'
]))
{
$extra
[
'minDate'
]
=
date
(
'Y-m-d'
,
strtotime
(
$extra
[
'minDate'
]));
}
if
(
isset
(
$extra
[
'maxDate'
]))
{
$extra
[
'maxDate'
]
=
date
(
'Y-m-d'
,
strtotime
(
$extra
[
'maxDate'
]));
}
// @see http://wiki.civicrm.org/confluence/display/CRMDOC/crmDatepicker
if
(
$type
==
'datepicker'
)
{
$attributes
=
(
$attributes
?
$attributes
:
[]);
$attributes
[
'data-crm-datepicker'
]
=
json_encode
((
array
)
$extra
);
if
(
!
empty
(
$attributes
[
'aria-label'
])
||
$label
)
{
$attributes
[
'aria-label'
]
=
CRM_Utils_Array
::
value
(
'aria-label'
,
$attributes
,
$label
);
}
$type
=
"text"
;
}
if
(
$type
==
=
'select'
&&
is_array
(
$extra
))
{
if
(
$type
==
'select'
&&
is_array
(
$extra
))
{
// Normalize this property
if
(
!
empty
(
$extra
[
'multiple'
]))
{
$extra
[
'multiple'
]
=
'multiple'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment