Filter Date custom filed

More
4 years 7 months ago #8781 by Ajeje Brazorf
How can I filter date custom field?

Please Log in to join the conversation.

More
4 years 7 months ago - 4 years 7 months ago #8782 by Ajeje Brazorf
I solved it like this:
- plugins/system/jlcontentfieldsfilter/jlcontentfieldsfilter.php
line 223 add
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
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
form.find('input[type="text"], input[type="date"]').val('');

- modules/mod_jlcontentfieldsfilter/assets/javascript/nojq_jlcontentfilter.js
var els = form.querySelectorAll('input[type="text"], input[type="date"]');
Last edit: 4 years 7 months ago by Ajeje Brazorf.

Please Log in to join the conversation.

Powered by Kunena Forum

Last from the forum

    • Как на кнопку Сбросить фильтр повесить Ajax?
    • Чтобы применить фильр нажимаем Применить фильтр и срабатывает Ajax изменеия на странице. Но чтобы сбросить фильтр, нужно сперва нажать Сбросить фильтр и потом повторно нажть Применить фильтр. Логичее было бы сделать при нажатии Сбросить фильтр, чтобы срабатывал сброс фильтра и Ajax. Как это сделать, не поможете?
    • In Modules Joomline / JL Content Fields Filter
    • JL Like 5.3.0. Очень редко срабатывает кнопка pint...
    • Давно пользуюсь JL Like, лет 8-10, с кнопкой pinterest проблем не было, кроме новой версии JL Like 5.3.0: сейчас при 9 запросах из 10, система пишет:Произошла ошибка JSON.parse: unexpected character at line 1 column 1 of the JSON dataДругие кнопки, например AddToAny pinterest – работаю на 100%.Можно сделать патч и поправить кнопкой pinterest в JL Like 5.3.0!?
    • In Plugins Joomline / JL Like / JL Like PRO
    • Не работает авторизация через ВК в Slogin
    • Добрый день. После недавнего обновления API перестала работать авторизация через ВК. Я создал новое приложение здесь id.vk.com/about/business/go/accounts/294204/apps но пишет "Выбранный способ авторизации не доступен для приложения. Попробуйте позже или обратитесь к администратору приложения" Можно как-то решить проблему?
    • In Component / Slogin
© 2010- JoomLine
The Joomla!® name is used under a limited license from Open Source Matters in the United States and other countries. joomline.net is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

email: This email address is being protected from spambots. You need JavaScript enabled to view it.