MyCalendar

Month, Week, and List calendar for displaying events on your site.

Back to MyCalendar Support

TiEsse
TiEsse

Hi, how to set 24h time format for calendar event?

Thanks

KurtJensen
KurtJensen

The next version will have this configurable for all times displayed.

For now you have two choices: Change: https://github.com/firemankurt/MyCalendar/blob/master/components/Events.php#L170 to :

'time' => $e->time,

or add:

return $this->time;

above line https://github.com/firemankurt/MyCalendar/blob/master/models/Event.php#L85.

TiEsse
TiEsse

ok, thanks the second option work. good job

Can I truncate the seconds? I don't want display it.

TiEsse
TiEsse

Hi, for now I have solved so:

 public function getHumanTimeAttribute()
    {
        if (!$this->time) {
             return '';
         }
         list($h, $m) = explode(':', $this->time);
         //$time = ($h > 12 ? ($h - 12) : intval($h)) . ':' . $m . ($h > 11 ? 'pm' : 'am');
         $time = $h . ':' . $m;
        return $time;
     }

Last updated

KurtJensen
KurtJensen

Version 1.1.5 has been released.

!!! This is an important update that contains breaking changes. MyCalendar will now be using Passage Permission Keys for permissions and you will need to install the plugin using code "kurtjensen.passage" if you use permissions for your events.

If you do not install Passage Permission Keys plugin then your protected events may not show or may be visible to anyone who visits your site until you do add PassagePermission Keys plugin.

This update also added raw data element to event array and applied config date/time to all components.

1-5 of 5