Filtering date interval

More
11 years 4 months ago #44636 by fgossart
Replied by fgossart on topic Filtering date interval
I try the same filter on a another different website running Joomla 3 and same result. IMG is replaced by a blue button

But theses two websites have a Artisteer generated template .

When I put the protostar template no problem !
Very strange...

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

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

fgossart wrote: And could I put initials filters so that the first filters are between currentday and currentday+7 ?


about filtering you can use current date +days , -days, +months, -months

by using the date SCOPE of the universal module, see its popup description


-- 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 #44651 by fgossart
Replied by fgossart on topic Filtering date interval
OK I will check with universal module.
But about the joomla artisteer template how can it remove the second calendar IMG ?
There is no plugin inside a template ?

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

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

looking at the page source of your link i can see misclosed HTML tags regarding the date picker

my guess is this:
- artisteer may be overriding the Joomla date-picker element and it displaying by adding custom HTML that that it is broken

but the above is just a guess


-- 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 #44706 by fgossart
Replied by fgossart on topic Filtering date interval
In templates files (artisteer) I found
$content = preg_replace('/<button[^>]*id="(.*)"><i class="icon-calendar"><\/i><\/button>/',
'<img src="' . JURI::base(true) . '/media/system/images/calendar.png" alt="Calendar" class="calendar" id="$1">', $content);

I'm not familiar with this code, but it's inside this preg_replace that first calendar button is replace with a calendar, and second is not... but the question is why ?

So my curiosity is to modify fleixcontent.fields.php (in classes) where filter as rendered

I just modify this line
$filter->html .= '<span class="fc_range">
(and insert a new line here)
</span>';
And now all is fine...
I hope you can soon give me a right answer
Pregreplace could not parse and replace the other string becauase too long and just adding a new line is html string is enough ?

Another question about date filtering
You wrote
about filtering you can use current date +days , -days, +months, -months

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
display in frontend 2014-02-03 and 1970-01-01
so it seems increase or decresae some days or any other value is not possible in a category view.

Anyway when I debug the SQL where is
( DATE_FORMAT(rel.value, "%Y-%m-%d") >= DATE_FORMAT('d', "%Y-%m-%d") ) AND ( DATE_FORMAT(rel.value, "%Y-%m-%d") <= DATE_FORMAT('-2 d', "%Y-%m-%d") ))
I don't think it's correct.

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

More
11 years 4 months ago #44711 by fgossart
Replied by fgossart on topic Filtering date interval
Hello I can add some comments on my latest reply.
I try to parse/debug code and I don't understand how it could works.
You call JTML::('date
in flexicontent.fields.php
Firstly in this source code
Code:
static function createCalendarField($value, $date_allowtime, $fieldname, $elementid, $attribs='', $skip_on_invalid=false, $timezone=false) { // 'false' timezone means ==> use server setting (=joomla site configured TIMEZONE), // in J1.5 this must be null for using server setting (=joomla site configured OFFSET) $timezone = ($timezone === false && !FLEXI_J16GE) ? null : $timezone; @list($date, $time) = preg_split('#\s+#', $value, $limit=2); $time = ($date_allowtime==2 && !$time) ? '00:00' : $time; try { if ( !$value ) { $date = ''; } else if (!$date_allowtime || !$time) { $date = JHTML::_('date', $date, JText::_( FLEXI_J16GE ? 'Y-m-d' : '%Y-%m-%d' ), $timezone); } else { $date = JHTML::_('date', $value, JText::_( FLEXI_J16GE ? 'Y-m-d H:i' : '%Y-%m-%d %H:%M' ), $timezone); } } catch ( Exception $e ) { if (!$skip_on_invalid) return ''; else $date = ''; }
I think the second argument $date is not possible. It should be $value ?

And if date function says same args than strtotime but spaces (3 day) are args function separator and so when I entere in GetDate I have the '3' only (day is ignored)
So I really can't understand

In the module there is a new class datetime.php but not in a view with initial filters

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.296 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