• ResolvedPlugin Author Manuel Schmalstieg

    (@targz-1)


    Request received via email:

    I am using your Minimalistic Event Manager plugin. I am do not know
    either php or other programming languages but would like to be able to
    make one minor adjustment in displaying date format in the widget.
    Instead of day-month-year display month-day-year. Could you please email
    me a simple instructions what and where should I change. If it is
    possible at all.

Viewing 1 replies (of 1 total)
  • Plugin Author Manuel Schmalstieg

    (@targz-1)

    In the wiki there are some instructions for customizing this.

    Let’s say you want “month-day-year” as in 11/06/2017.

    Here’s how to this can be expressed using the shortcodes of the PHP “date” function, documented at php.net

    m = Numeric representation of a month, with leading zeros
    d = Day of the month, 2 digits with leading zeros
    Y = A full numeric representation of a year, 4 digits

    So this would get the expected result:

    function my_custom_filter_example( $mem_date, $mem_event_list ) {
        
        return date_i18n('m/d/Y', $mem_event_list["start-unix"]);
        
    }
    add_filter( 'mem_event_date_display', 'my_custom_filter_example', 10, 2 );

    Caveats:
    This code is only considering the start date, not the end date.

    How to add this custom PHP code to your site?
    Here’s a tutorial that may help.

Viewing 1 replies (of 1 total)
  • The topic ‘Change display date format in widget (month-day-year)’ is closed to new replies.