WordPress.org

Ready to get started?Download WordPress

Forums

Google Calendar Widget
Delete end-time event (2 posts)

  1. brendebr
    Member
    Posted 3 years ago #

    Hello,
    I use the google calendar widget on my website http://www.brucebandfanclub.nl.
    It works good, only I don't want to fill in the end-time of the event (only the time when the event starts). Does anyone know how I can delete, or not choose, the end-time of the event?

  2. Poco
    Member
    Plugin Author

    Posted 3 years ago #

    You can remove the end-time from the event by editing ko-calendar.js

    Look for the code like the following.

    else if (oneDayEvent)
    {
    	dateString = startJSDate.toString("ddd, MMM d, yyyy");
    	dateString += ', ';
    	dateString += startJSDate.toString("h:mm tt");
    	dateString += ' - ';
    	dateString += endJSDate.toString("h:mm tt");
    }

    Removing the last two lines beginning with "dateString" will remove the end time from events that do not span multiple days.

    Remove

    dateString += ' - ';
    dateString += endJSDate.toString("h:mm tt");

    To also remove the end time from multi-day events, remove the following code in the block below the one above.

    dateString += ' - ';
    if (!endTime.isDateOnly())
    {
    	dateString += endJSDate.toString("ddd, MMM d, yyyy h:mm tt");
    }
    else
    {
    	dateString += endJSDate.toString("ddd, MMM d, yyyy");
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic