MEC Metadate

Hi,

in the datepicker in backend of mec and the out put of meta “mec_start_date” is still displaying Y-M-D. Where can i change this…which file is responsible for that?

Thanks for your help.

cy

Hi Cy,

Thanks for reaching out.

The only changeable format is when displayed in the front, but, in the backend, it’s strictly implemented by that format. But, you can change them by editing this file

\wp-content\plugins\modern-events-calendar\assets\js\events.js

Example,

    $('#mec_start_date').datepicker(
    {
        changeYear: true,
        changeMonth: true,
        dateFormat: 'yy-mm-dd',
        gotoCurrent: true,
        yearRange: 'c-3:c+5',
    });

There are multiple of it in there, you may edit them according to your preference. I don’t recommend it since update will just overwrite it.

Thanks!

Hi Rad,
this file seems to do nothing. Even if i delete it, mec is still working…and no change.

AND: I need to display “mec_start_date” in front end in d-m-y, sorry for confusing…

thanks,
cy.

Hello Cyrock,

Are you displaying the events by using the MEC shortcode? Please edit your shortcode and define the date format in the shortcode settings.

Hope this helps.

No, i am using the grid-Plugin to dissplay meta data “mec_start_date” of mec.

thanks
cy.

Hello Cyrock,

Since you are using the Grid plugin, the date format must have been loaded in the Grid skin. You will need to edit the skin and change it.

To know how you can edit the grid skin, please check this out:

Hope this helps.

(…) Yes, its possible to use “post Date” but it does display the meta “mec_start_date” but the create-date of the post. And even you put the meta in, the date is showing YYYY-MM-DD.

I know how to edit The Grid, sorry. I need to display the Date in DAY. MONTH. YEAR.

Thanks,
Cy.

Hi Cy,

Thank you for the clarification, please change the Date Format in M.E.Calendar > Settings > Event Details/Single Event Page

Or try changing the date format in your WordPress Settings > General

Hope it helps,
Cheers,

Hi, thanks for wrinting me…

You did not serious send me this…? I know how to edit date format in WP. (…)

Thanks.
cy.

Hi @cyrock,

Firstly, please note that The Grid and The Modern Events calendar are two independent plugins. Both are bundled plugins with X and we provide support for questions about their setup provided that the options you are looking for are available out of the box.

In this case, The Grid meta option might have its default format for date meta that are from other post type.

A quick way to solve this would be through custom Javascript. Please try adding this in your Global JS:

(function($){

    $('.dkk-date').each(function(){
	    var date = $(this).text().split('-');;
	    $(this).text( date[2] + '.' + date[1] + '.' + date[0] );
    });

})(jQuery);

This is not the most ideal way to achieve this result but the quickest one to achieve the output you are aiming for. Also, since this is a custom code, you will have to maintain the code in case it will stop working or if you require further customization.

We do encourage you to check The Grid documentation resource is you want to read more about the Grid and its specific features.

Hope this helps.

Dear Jade,
thanks for your answer. This hepls me a lot. i know about this, but an special request of a specila client. i am crawling since days for solution. It works! Thank you very much!!

regards,
Christian

You’re most welcome, Christian. Glad to hear it helped! :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.