Filtering date interval

More
11 years 4 months ago #44720 by ggppdk
Replied by ggppdk on topic Filtering date interval

I found some tips using d for curdate but not working when adding + or - x days
ex : initial filters date range
50##d---5 d


Hello
- as i said above,
this is not supported by initial OR persistent(=locked) filter values

-- i said that referring to current date is supported by module DATE SCOPE



-- about artisteer code, since you found it, then put this replacement command into comments !

it is just meant to add ARTISTEER styling to the calendar so , just don't use it (since you found it ;) )

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
11 years 4 months ago #44724 by fgossart
Replied by fgossart on topic Filtering date interval
About date scope I understand now. I thought you said that it was already done like universal module.
Really it's not possible now... ok.
I'll try to do it with universal module coding for my own usage

About date button, it's not really what you think
If I comment artisteer code, I only have the 2 buttons but not the calendar img.
So the <img > string seems to be provided by artisteer replacement, not by your code... or it has been already replaced before ;-)
I can just say that I solved this problem by cutting the long fields generated string (by your code described in my latest comments, just insert a new line somewhere. If not sure see before where I put it with success.
I think this mod will not change anything else in Flexicontent so you could put it in next beta or release ?

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

More
11 years 4 months ago #44725 by ggppdk
Replied by ggppdk on topic Filtering date interval
Hello

maybe also send a bug report to artisteer, showcasing the bad / misaligned HTML tags for calendar field ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
11 years 4 months ago #44726 by fgossart
Replied by fgossart on topic Filtering date interval
The bug is NOT in artisteer or I'm getting mad :-)
I use latest FC beta (daily build) with latest joomla 3.2

I try again a date range filter with the standard protostar template and there are no date calendar icons just blue buttons.

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

More
11 years 4 months ago #44730 by fgossart
Replied by fgossart on topic Filtering date interval
I put a mod (or hack) to accept filter scope values
in com_flexicontent/models/category.php
I add
Code:
defined( '_JEXEC' ) or die( 'Restricted access' ); require_once (JPATH_SITE.DS.'modules'.DS.'mod_flexicontent'.DS.'classes'.DS.'datetime.php');
And then in function _buildFilterWhere()
i add some lines
Code:
$filtervalue = JRequest::getVar('filter_'.$filtre->id, '', ''); // Skip filters without value $empty_filtervalue_array = is_array($filtervalue) && !strlen(trim(implode('',$filtervalue))); $empty_filtervalue_string = !is_array($filtervalue) && !strlen(trim($filtervalue)); //here some new line to replace initial scope filters if ($filtre->field_type=='date' && !$empty_filtervalue_array && !$empty_filtervalue_string) { date_time::replace_scope_category_filters($filtervalue); JRequest::setVar('filter_'.$filtre->id, $filtervalue); }

and in mod_flexicontent_classes/datetime.php I add a new function
Code:
function replace_scope_category_filters(&$filtervalue) { $search = array(); if (!is_array($filtervalue)) $search[1]=$filtervalue; else $search=$filtervalue; foreach ($search as $filterv_key=>$filterv_val) { $pattern = '/d|m|Y|H|i|s/'; if (preg_match($pattern, $filterv_val)) // is not a DATE but a SCOPE { $edate=explode(' ',$filterv_val); $new_date=''; if (count($edate)!=2) $new_date=date_time::shift_dates($new_date, '', $edate[0]); else $new_date=date_time::shift_dates($new_date, $edate[0], $edate[1]); $search[$filterv_key]=$new_date; } } if (!is_array($filtervalue)) $filtervalue=$search[1]; else $filtervalue=$search; }

It's just a first "hack" and works fine now for me if I put in initial (or probably permanent) filter some values like filter_id##d---15 d
Not tested with m Y but should work too.

I hope now you can soon add this enhancement so that I will not have to hack everytime

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

More
11 years 3 months ago #45735 by fgossart
Replied by fgossart on topic Filtering date interval
Could you confirm this new feature described above could be add for next release ?
There is no compatibility problems with other features, so it's an enhancement (I hope :)

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.903 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save