Events – 24h time format and recurring (custom) calendar format

This topic contains 12 replies, has 4 voices, and was last updated by  amweb 5 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #503338

    amweb
    Full Member
    Post count: 55

    Dear GD support team,

    I have two questions concerning the add listing page for events:

    1. How can I change the time format in events from AM/PM to 24h (as already set in the WordPress settings)? I did not find any detailed info and am actually using the following snippet from V1 (which seems to work, but I would like to avoid eventual “hidden” issues):
      function gde_24hour_times( $times ) {
      	foreach($times as $key=>$val){
      		$times[$key]=$key;
      	}
          return $times;
      }
      add_filter( 'geodir_event_schedule_times', 'gde_24hour_times' );
    2. When trying to create a recurring event with the “Custom” recurrence, the calendar uses a different format than the one set in the WordPress settings (which BTW gets correctly applied on the event start/end dates):
      • The first day of the week is Sunday (instead of Monday)
      • The months are displayed in EN (instead of IT)
      • The days are displayed in EN (instead of IT)
      • The design/layout is different

    Thank you in advance for your support.

    #503371

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    a developer has been alerted about this.

    They’ll reply as soon as possible, but at this point I think it’ll be after the week end.

    Thanks for your patience

    #503660

    Kiran
    Moderator
    Post count: 7069

    1) Try following HP snippet to show hours in WordPress time format in add/edit event form.

    
    
    function gd_snippet_event_schedule_times( $times ) {
    	$_times = array();
    	
    	foreach ( $times as $value => $label ) {
    		$_times[ $value ] = date_i18n( get_option( 'time_format' ) , strtotime( $value ) );
    	}
    
    	return $_times;
    }
    add_filter( 'geodir_event_schedule_times', 'gd_snippet_event_schedule_times', 20, 1 );


    2)
    Have you translated GeoDirectory core & Event Manager plugin?

    Please provide admin credentials to look inot more.

    Kiran

    #503678

    amweb
    Full Member
    Post count: 55

    Hi Kiran,

    Thank you for your feedback.

    1) I used your PHP snippet and it seems to work properly, thank you.

    2) Yes, I have translated GD core and Event Manager plugin in WPML, at least the strings that I found until now (I also did a test by translating all remaining strings for “August” to see if it would get translated in the calendar but it still doesn’t change anything). The calendars for “Start date” and “End date” appear correctly (see first two screenshots), the issue is that the appearance, first day of week and language for the calendar under “Recurring event” >> “Repeats = Custom” differ completely (see third screenshot), as if they were created with a completely different component (as also proven by the different classes in the resulting frontend code). In addition it seems that this calendar is not localized (see test described above for the string “August”, but nothing has changed in the frontend).

    NB: I will send you admin credentials in the next (private) reply.

    Kind regards,
    Aron

    #503682

    amweb
    Full Member
    Post count: 55
    This reply has been marked as private.
    #503689

    Kiran
    Moderator
    Post count: 7069

    Hi Aron,

    This has been fixed and it will be in next release.

    Provide us FTP credentials if you to apply patch from our side to fix it now.

    Thanks,
    Kiran

    #503934

    amweb
    Full Member
    Post count: 55
    This reply has been marked as private.
    #504569

    amweb
    Full Member
    Post count: 55

    Hi, are there any news about the patch?

    Unfortunately I still see the wrong calendar format for the “custom” recurring events.

    #504578

    Kiran
    Moderator
    Post count: 7069

    Please try now after clearing your browser cache.

    Kiran

    #504580

    amweb
    Full Member
    Post count: 55

    Hi Kiran,

    Thanks for the update.

    We are almost there: I now correctly see the calendar months and days in italian, but the first day of the week is still Sunday instead of Monday.

    Can you please have another look?

    Thank you very much and kind regards

    #504616

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #504908

    Kiran
    Moderator
    Post count: 7069

    Hi,

    Please check now. In event calendar week start day can be managed from widget/shortcode settings.

    Kiran

    #504921

    amweb
    Full Member
    Post count: 55

    Hi Kiran,

    Perfect, now it works exactly as expected!
    Thank you very much for your support (and thanks also for the tip about the event calendar widget/shortcode).

    Kind regards,
    Aron

Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount