Filter Date custom filed

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

Please Log in or Create an account to join the conversation.

More
2 years 11 months ago - 2 years 11 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: 2 years 11 months ago by Ajeje Brazorf.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum

Last from the forum

    • jomexej304
    • The crimson peony shrimp sushi is big. The shrimp body is almost 9 centimeters long. It's miles sweet and chewy. The beef is thick and very scrumptious. The clam meat cooked with sake is sweet and has no sand. 
    • In Component / Afisha Joomla
    • Баг?
    • У меня одна категория материалов. В этой категории несколько сотен материалов. Есть несколько кастомных полей.Первое типа list (categorywork), другие* list c мультивыбором. Другие* зависят от первого Атрибут showon (categorywork:1, categorywork:2 и так далее). Какие настройки я должен сделать на вкладке "Параметры фильтрации", что бы в модуле подбора вылезали не сразу все "Другие", а только та, которая зависит от showon (как это реализовано в Joomla)? Установлена Joomla 5.1.4 + JL Content Fields Filter v.3.0.0 То есть вылезают все select, даже те которые содержат в себе параметры отсутствующие у материалов (не назначенные к материалам). Изображения: раз: drive.google.com/file/d/1wDtY_iBL5StjrTv...3co/view?usp=sharing два: drive.google.com/file/d/1Vqy5MlJWC15i3z1...nbo/view?usp=sharing
    • In Modules Joomline / JL Content Fields Filter
    • sports
    • Tesla CEO Elon Musk was snubbed from TIME Magazine’s “Most Influential People in AI” list, despite being the driving force behind the company’s self-driving efforts, data collection, and the development of the humanoid robot Optimus, along with other projects, like xAI. TIME released its list today, highlighting what it intended to be a compilation of the most brilliant names in AI. Those on the list have achieved big things, and the names on the list are not to be discredited in any way. Some of the names on the list are the biggest in tech and AI development. Jensen Huang, CEO of Nvidia, Sam Altman, CEO of OpenAI, Satya Nadella, CEO of Microsoft, and Mark Zuckerberg, CEO of Meta, are all included on the list. These are just a few of the names that TIME listed as the most influential in AI, but Musk was not included.  
    • In Общий форум / Общие вопросы по Joomla
© 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.