WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Editorial Calendar] Change default schedule time

[Plugin: Editorial Calendar] Change default schedule time

  • RosemaryJayne
    Member

    @rosemaryjayne

    I would like to be able to change the default scheduled time for posts – in my specific case I would like to change it from 10am to 2pm, I have tried changing (what I thought were) the relevant lines in date.extras.js from 1000 to 1400, but have not succeeded.

    Line 60:

    $D.strftime = function (format, time) {
            return new Date(time * 1400).$format(format);
        };

    Line 77:

    $D.strtotime = function (time) {
            var d = $D.parse(time);
            d.addMinutes(d.getTimezoneOffset() * -1);
            return Math.round($D.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds()) / 1400);
        };

    What should I change to achieve this? And would it be possible to integrate a user option for this in future?

    http://wordpress.org/extend/plugins/editorial-calendar/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Zack Grossbart
    Member

    @zgrossbart

    Thank you for using the Editorial Calendar. Changing code to set the default post time is pretty easy. Look in edcal.js on line 706. That defines a function called addPost which looks like this:

    addPost: function() {
    jQuery(‘#newPostScheduleButton’).addClass(‘disabled’);

    var date = jQuery(this).parent().parent().attr(‘id’);

    var formattedtime = ’10:00′;
    if (edcal.timeFormat !== ‘H:i’) {
    formattedtime += ‘ AM’;
    }

    var post = {
    id: 0,
    date: date,
    formatteddate: edcal.getDayFromDayId(date).toString(edcal.previewDateFormat),
    time: formattedtime
    };
    edcal.showForm(post);
    return false;
    }

    You can change the time here to whatever you want. The better change for supporting upgrades is to set this function from another file.

    Good luck,
    Zack

    RosemaryJayne
    Member

    @rosemaryjayne

    Thanks! Really simple when you know what you’re looking for.

    And thank-you very much for the great plugin, it’s changed the way I use WordPress and made it much easier to blog 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Editorial Calendar] Change default schedule time’ is closed to new replies.