Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • southsouthworld Friend
    #1048486
    This reply has been marked as private.
    Luna Garden Moderator
    #1049123

    Hi,

    Thanks for reporting.

    I passed your issue to the developer, he will fix this soon.

    southsouthworld Friend
    #1049216
    This reply has been marked as private.
    southsouthworld Friend
    #1049384

    Thank you very much, Luna, for everything! It has been great support. 🙂

    Mo0nlight Moderator
    #1051246

    Hi.

    You could try this:
    Edit the file:
    components/com_jak2filter/models/itemlist.php

    Look for:

                if($start_created == $end_created) {
                    $end_created .= ' 23:59:59';
                }

    Change to:

    $end_created .= ' 23:59:59';
    southsouthworld Friend
    #1051254

    Hi I just wanted to know if the developer was able to find the solution yet? Many thanks.

    Kindest regards,
    Alyssa

    Anonymous Moderator
    #1051838

    Hi I just wanted to know if the developer was able to find the solution yet? Many thanks.

    You can give Moonlight’s solution in the reply above a try.

    southsouthworld Friend
    #1053379

    I just saw this now Moonlight! I wasnt able to see Moonlight’s response before.

    I can’t find:
    if($start_created == $end_created) {
    $end_created .= ‘ 23:59:59’;
    }

    In the file…

    southsouthworld Friend
    #1053384

    Ok I found it and after applying the change, the site went down and stopped working…

    southsouthworld Friend
    #1053385

    Ok I forgot to get rid of the { so the website is working again.

    I tried search from 03/08/2017 back to 03/03/2016 but 0 results came up.

    Could you please check if my itemlist.php codes are correct below?

    //search by date
    $dateFormat = ‘Y-m-d’;
    $dtrange = $jinput->getString(‘dtrange’, ”);

        $now = new JDate();
    
        switch($dtrange) {
            case 'today':
                $start_created = $end_created = new JDate();
                break;
            case '-1d':
                $start_created = new JDate('-1 day');
                $end_created = new JDate();
                break;
            case '-7d':
                $start_created = new JDate('-7 days');
                $end_created = new JDate();
                break;
            case '-1m':
                $start_created = new JDate('-1 month');
                $end_created = new JDate();
                break;
            case 'tw':
                $dayofweek = $now->dayofweek;
                $start_created = new JDate('-'.($dayofweek-1).' days');
                $end_created = new JDate($dayofweek == 7 ? 'now' : '+'.(7-$dayofweek).'days');
                break;
            case 'lw':
                $dayofweek = $now->dayofweek;
                $start_created = new JDate('-'.($dayofweek -1 + 7).' days');
                $end_created = new JDate('-'.($dayofweek).' days');
                break;
            case 'tm':
                $daysinmonth = $now->daysinmonth;
                $day = $now->format('d');
                $start_created = new JDate('-'.($day-1).' days');
                $end_created = new JDate($day == $daysinmonth ? 'now' : '+'.($daysinmonth-$day).'days');
                break;
            case 'lm':
                $lm = new JDate('-1 month');
                $daysinmonth = $lm->daysinmonth;
                $day = $now->format('d');
                $start_created = new JDate('-'.($day-1 + $daysinmonth).' days');
                $end_created = new JDate('+'.(-$day).'days');
                break;
            case 'range':
            default:
                $start_created = $jinput->getString('sdate', '');
                $end_created = $jinput->getString('edate', '');
                break;
        }
        if($start_created instanceof JDate) {
            $start_created = $start_created->format($dateFormat);
        }
        if($end_created instanceof JDate) {
            $end_created = $end_created->format($dateFormat);
        }
    
        if ($start_created){
            $sql .= " AND (i.created >= ".$db->quote($start_created).")";
        }
    
        if ($end_created){
                $end_created .= ' 23:59:59';
            $sql .= " AND (i.created <= ".$db->quote($end_created).")";
        }
    Mo0nlight Moderator
    #1053635

    Hi.

    Did you get it sorted out already? I didn’t see anything wrong when I checked.

    If you still have any problem, please post your ftp account and I will check for you.

    southsouthworld Friend
    #1053811
    This reply has been marked as private.
    Mo0nlight Moderator
    #1054374

    Hi,

    The code is still correct.

    Kindly make sure that:

    I tried search from 03/08/2017 back to 03/03/2016 but 0 results came up.

    You have to search from (earlier date) to (later date) You couldn’t search from (later date) to (earlier date)

    And i couldn’t log into backend of your site with provided admin account anymore.

    southsouthworld Friend
    #1054649

    Oh thank you for clarifying I have been choosing the later date then the earlier date! Thank you for letting me know Moonlight! I can’t believe I overlooked that! Many thanks.

    Last question, is that how do I make the search results display only K2 items under directory and not K2 items under blog?

    Many thanks!

    Mo0nlight Moderator
    #1054666

    Hi,

    I couldn’t log into your site with provided info, kindly check and update again.

Viewing 15 posts - 1 through 15 (of 16 total)

This topic contains 16 replies, has 4 voices, and was last updated by  southsouthworld 7 years, 3 months ago.

The topic ‘Search by date range not showing items by creation date’ is closed to new replies.