Okay
  Public Ticket #1702682
How to order events by time
Closed

Comments

  • timmytag started the conversation

    Hi, I have a problem with the order of the events added in a calendar.
    In some cases, the order of events by time  is not correct.
    Can you take a look to the attached image?
    What I can do to order the events correctly?

  •  799
    Zhivko replied

    Is it possible to provide me with ftp access again to make changes to the stec.js file?

    Or if you want to make them by yourself you could open file 

    plugins\stachethemes_event_calendar\front\js\stec.js

    on line 5847 you should see this code:

                sortByFeatured: function (a, b) {
                    if (a.featured != 0 && b.featured != 0) {
                        return a.start_date_timestamp - b.start_date_timestamp;
                    } else {
                        return b.featured - a.featured;
                    }
                },


    Change it to:


                sortByFeatured: function (a, b) {
                    
                    if (a.featured != 0 && b.featured != 0) {
                        return a.start_date_timestamp - b.start_date_timestamp;
                    } else {
                        return (Math.abs(b.featured - a.featured) != 0 ? b.featured - a.featured : -1);
                    }
                },

    Stachethemes Developer

  • timmytag replied

    Ok, I have done.

    It's works.

    Thank you so much.