WordPress.org

Forums

WP Calendar
Can I display end time? (6 posts)

  1. Number_6
    Member
    Posted 1 year ago #

    Could someone teach me how to display an event's end time on the full calendar?

    My purpose for the calendar requires that I display the end time as well as the beginning time of an event as I am displaying Astrological movements and the end of a particular movement in the heavens is as important as the beginning.

    Thank you.

    http://wordpress.org/plugins/wp-calendar/

  2. Cara Peckens
    Member
    Posted 1 year ago #

    I had to tackle the same problem. To accomplish this I modified the fullcalendar.js file.

    Change line 58 to
    '': 'h:mm{ - h:mm}' // default

    Change line 2931 to
    .text(formatDate(event.start, opt('timeFormat')) + formatDate(event.end, opt('timeFormat')) + ' - ' + event.title);

    After you've made these modifications you will need to minify and replace the fullcalendar.min.js file

    You can see it in action at: http://krieger.jhu.edu/economics/about/calendar/

  3. Number_6
    Member
    Posted 1 year ago #

    Thanks a million. But what do you mean by "minify and replace"?

  4. Number_6
    Member
    Posted 1 year ago #

    Making those changes does nothing and "minifying" the file renders the calendar invisible. =/

  5. ladysundancing
    Member
    Posted 1 year ago #

    I am having the exact same problem!
    The changes in the fullcalendar.js don't help.

  6. Rajendhiran Muthusamy
    Member
    Posted 11 months ago #

    Hi,
    I created a function to showe start and end time in the fullcalendar.js file

    // Change formatDates function in the below line....
    "<span class='fc-event-time'>" +
    htmlEscape(
    formatDates(event.start, event.end, opt('timeFormat'))
    ) +
    "</span>";

    //After........
    "<span class='fc-event-time'>" +
    htmlEscape(
    StartandEndDates(event.start, event.end)
    ) +
    "</span>";

    ...............

    // Add a new function name as StartandEndDates
    function StartandEndDates(startDate, endDate)
    {

    var start=startDate.getHours();
    if(start>12){start=start-12;}
    var sMinutes=startDate.getMinutes();
    if(sMinutes=='0'){sMinutes='00';}

    var sAm= start>=12?'pm':'am';

    var end=endDate.getHours();
    if(end>12){end=end-12;}

    var eMinutes=endDate.getMinutes();
    if(eMinutes=='0'){eMinutes='00';}
    var sPm= end>=12?'pm':'am';

    var result=start+":"+sMinutes+sAm+"-"+end+":"+eMinutes+sPm;

    return result;
    }

    /////////////////

    With Regards,
    Rajendhiran Muthusamy

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.