Filter Date custom filed

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

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

Powered by Kunena Forum

Last from the forum

    • gotopbestblogger
    •   In it for the long run, during 2024 Nexon has taken the web3 extension of its MapleStory IP not just wider, but also deeper. Garnering 400,000 users during a single day in its latest MapleStory N playtest showcases Nexon’s growing understanding on sustainable ecosystem building. The release of its NXPC token model makes MapleStory Universe users even more excited about where the project is heading as we’re on the verge of a new year.
    • In Plugins Joomline / JL Comments / JL Comments PRO
    • voip phone
    • One day, a monkey drove his car near a lake. Sudden, he saw a tiger under a tree. The tiger saw him, too. The tiger ran very fast at the monkey. The monkey was very afraid and he and his car fell into the lake. The monkey couldn't swim and he shouted. A rabbit came and he jumped into the lake. The abbit swam to the monkey but did not help him. Both of them shouted forhelp. Luckily, a giraffe came along. He was very tall. He helped the rabbit and the monkey.  
    • In Component / JL Mail
    • bloggingaboutanythingonline
    • One day, a monkey drove his car near a lake. Sudden, he saw a tiger under a tree. The tiger saw him, too. The tiger ran very fast at the monkey. The monkey was very afraid and he and his car fell into the lake. The monkey couldn't swim and he shouted. A rabbit came and he jumped into the lake. The abbit swam to the monkey but did not help him. Both of them shouted forhelp. Luckily, a giraffe came along. He was very tall. He helped the rabbit and the monkey.  
    • In Component / JL Mail
© 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: sale@joomline.ru