Okay
  Public Ticket #3029551
Bug: Select different month starts with current day
Closed

Comments

  •  5
    joshivince started the conversation

    Dear Zhivko,

    when you open my site at feschtkalender.info you see my event list beginning from today (22nd April 2022) - what is good. When you then want to see the events - for example - from June, you can choose the month "June" by clicking the month drop down selector. Please do so, to see the bug:  The June events are then displayed from the current day. Means: The events of June are displayed from 22nd downwards only, not from the 1st of June.

    Hope you understand what I mean.

    Thanks for a nice fix in advance,
    Vincent

  •  877
    Zhivko replied

    Hi,

    It's not a bug. Someone hid the day dropdown for the agenda view. By default it should be visible.

    Anyway, I understand your problem and perhaps it is indeed good idea to reset the day to 1 so here's a hook that does this:

    add_action('wp_footer', function () {
        if (!wp_script_is('stec-js')) {
            return;
        }
        ?>
        <script type="text/javascript">
            (function($) {
                $(function() {
                    $.stecExtend(function(m) {
                        m.$instance.$top.find('.stec-top-menu-date-dropdown')
                            .on(m.helper.clickHandle(), 'ul li', function() {
                                if (m.glob.options.view === 'agenda') {
                                    m.glob.options.day = 1;
                                }
                            });
                    });
                });
            })(window.jQuery);
        </script>
    <?php
    });
    

    Stachethemes Developer

  •  5
    joshivince replied

    OH! Yes it was me... I hid the day selector.

    The hook works perfect! Thanks also here.

    This ticket can be closed.

    Regards,

    Vincent

    (Feel free to edit my headline if it is really not a bug, to clarify for others)