- Posts: 9
- Thank you received: 0
Filter Date custom filed
- Offline
- New Member
Less
More
4 years 11 months ago #8781
by
Filter Date custom filed was created by
How can I filter date custom field?
Please Log in to join the conversation.
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
4 years 11 months ago - 4 years 11 months ago #8782
by
Replied by on topic Filter Date custom filed
I solved it like this:
- plugins/system/jlcontentfieldsfilter/jlcontentfieldsfilter.php
line 223 add
- plugins/system/jlcontentfieldsfilter/fields/jlcontentfieldsfilterfields.php
line 83 add
- /modules/mod_jlcontentfieldsfilter/layouts/mod_jlcontentfieldsfilter
duplicate range.php file and rename in calendar.php
in input type date change in "date"
- modules/mod_jlcontentfieldsfilter/assets/javascript/jlcontentfilter.js
line 46
- modules/mod_jlcontentfieldsfilter/assets/javascript/nojq_jlcontentfilter.js
- plugins/system/jlcontentfieldsfilter/jlcontentfieldsfilter.php
line 223 add
Code:
case 'calendar':
if(!empty($v)){
if(is_array($v)){
if(!empty($v['from']) && !empty($v['to'])){
$where = '(field_id = '.$k.' AND `value` BETWEEN "'.$v['from'].' 00:00:00" AND "'.$v['to'].' 00:00:00")';
}
else if(!empty($v['from'])){
$where = '(field_id = '.$k.' AND `value` >= "'.$v['from'].' 00:00:00")';
}
else if(!empty($v['to'])){
$where = '(field_id = '.$k.' AND `value` <= "'.$v['to'].' 00:00:00")';
}
}
else{
$where = '(field_id = '.$k.' AND value LIKE '.$db->quote('%'.$v.'%').')';
}
}
break;
- plugins/system/jlcontentfieldsfilter/fields/jlcontentfieldsfilterfields.php
line 83 add
Code:
case 'calendar':
$options = HTMLHelper::_('select.option', 'calendar', Text::_('PLG_JLCONTENTFIELDSFILTER_FILTER_CALENDAR'));
break;
- /modules/mod_jlcontentfieldsfilter/layouts/mod_jlcontentfieldsfilter
duplicate range.php file and rename in calendar.php
in input type date change in "date"
- modules/mod_jlcontentfieldsfilter/assets/javascript/jlcontentfilter.js
line 46
Code:
form.find('input[type="text"], input[type="date"]').val('');
- modules/mod_jlcontentfieldsfilter/assets/javascript/nojq_jlcontentfilter.js
Code:
var els = form.querySelectorAll('input[type="text"], input[type="date"]');
Last edit: 4 years 11 months ago by .
Please Log in to join the conversation.
Time to create page: 0.174 seconds