WordPress.org

Ready to get started?Download WordPress

Forums

Editorial Calendar
[resolved] Any Way to Display EXACT Post Times? (18 posts)

  1. technabob
    Member
    Posted 2 years ago #

    First off, great plugin. Should be standard WordPress functionality, IMHO. However, I have one minor issue. We schedule our posts every 45 minutes on one of our sites, but the calendar view rounds all times to the prior hour. This makes scheduling in that view very difficult for us, and it's something that would be really great if the calendar actually displayed the full time (or at least offered this as an option). We actually plan on increasing the frequency of posts, so this will become an even bigger issue for us over time.

    Thoughts?

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

  2. Zack Grossbart
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for using the calendar. We actually do support scheduling posts down to the minute. When you change the time in the quick edit screen you can either select the time from the pull down menu, or type in a type you want.

    The calendar still shows the times rounded to the hour so save space, but they posts will come in the right order based on their times, and the time will be saved.

    It would be possible to display the exact time in the calendar by changing the code, but there's no other way to do it.

    Thanks,
    Zack

  3. technabob
    Member
    Posted 2 years ago #

    Yep, I figured out that you can schedule to exact times, but it would still be really helpful for us to be able to see the post times on the calendar, since we often juggle things around during the day and without seeing the times on the calendar, you have to click into the post, which I can already do on the main wordpress admin.

    Please consider this as an enhancement for a future release if you can. I'd be happy to make a contribution via PayPal if that helps :)

  4. Zack Grossbart
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for the request and the offer of the donation. We don't take money, but it's always nice to get the offer.

    You could change the time format with a tweak to the PHP. Let me know if you're interested and I'll point you in the right direction.

    Thanks,
    Zack

  5. technabob
    Member
    Posted 2 years ago #

    Ok, thanks for the support. I suppose a patch would be the best thing for now - though I hate the idea of branching off the main build and having to patch every time you update. That said, getting a patch in there would be better than not having it at all.

    Feel free to send along any tips on where to change the PHP to tweak this.

  6. technabob
    Member
    Posted 2 years ago #

    Hah, I figured it out...

    On line 683 of edcal.php, I simply changed

    "formattedtime" : "<?php $this->edcal_json_encode(the_time($timeFormat)); ?>",

    to
    "formattedtime" : "<?php the_time() ?>",

    That seems to do the trick.

    Any other implications of that change?

  7. Zack Grossbart
    Member
    Plugin Author

    Posted 2 years ago #

    That's the area I was going to recommend, but you can do a little better by extending the PHP class from another file. If you override the edcal_postJSON function from another file you can still get upgrades and you don't have to keep making the same patch.

    I need to think of the best way to handle this in the calendar. Most people don't need the full time and I'm reluctant to add another preference. I need to think about it a little more.

    -Zack

  8. technabob
    Member
    Posted 2 years ago #

    Ah good thought on externalizing it. Can I modify the output of the edcal_postJSON function using a filter in my theme's functions.php? I wasn't sure of the order of execution of that stuff so didn't know if I could tackle it that way.

  9. Zack Grossbart
    Member
    Plugin Author

    Posted 2 years ago #

    I haven't tried it, but I think you could use the override_function function (http://php.net/manual/en/function.override-function.php). That way you can replace the whole function.

    You could also try a filter. The output of that function is simple JSON so it should be easy to change it. I haven't tried doing this, so I'm curious how it works.

    Thanks,
    Zack

  10. LaMonte Forthun
    Member
    Posted 2 years ago #

    Hi Zack,

    Great looking plugin, it looks like it's going to be an amazing organizational tool for our news site...

    I wanted to jump in on this thread, even though it's a bit old. I too post on an exact time basis and have guidelines that we are trying to loosely keep for time between posts in various categories. Looking at the calendar and seeing the time rounded to the hour doesn't work very well for me, so I implemented the above code and it's definitely better for us. If you've got a better way to handle this, I'd be very grateful to hear it.

    I'd also vote for a check box preference if possible on the screen options right after 'Time of Day'. That would be perfect...

    Thanks again,

    LaMonte Forthun

  11. Zack Grossbart
    Member
    Plugin Author

    Posted 2 years ago #

    Hi LaMonte,

    Thanks for using the Editorial Calendar. We've heard the request to add a "Show full time" option from a few of our users, but we're always wary of adding too many options. For now we can make a small JavaScript edit to make this work.

    I'm going to make a change in the next version to make this a WordPress option. That means you can set it once in the options table and don't have to worry about it when you upgrade to newer versions of the plugin.

    Would that help?

    Thanks,
    Zack

  12. technabob
    Member
    Posted 1 year ago #

    Zack:

    Did this change ever get made? I wasn't sure, since I've been manually patching every time I upgrade.

  13. Zack Grossbart
    Member
    Plugin Author

    Posted 1 year ago #

    Yes this is in the latest version. We're looking at time_format like this:

    get_option("time_format")

    I hope it helps,
    Zack

  14. Zack Grossbart
    Member
    Plugin Author

    Posted 1 year ago #

    I meant to mark this as resolved with my previous post.

  15. technabob
    Member
    Posted 1 year ago #

    So does that mean I need to manually add a row to the options table, or is there an admin control somewhere for this?

  16. Zack Grossbart
    Member
    Plugin Author

    Posted 1 year ago #

    I don't have an admin tool to set this up.

  17. technabob
    Member
    Posted 1 year ago #

    That's fine, but what is the query I need to run against the DB in order to set that to the proper value for exact times?

  18. technabob
    Member
    Posted 1 year ago #

    So I think there's still a minor issue with this. If the time_format option is set to "g:i a" in the database, times are still displayed as the whole hour (i.e. 9:00am, even if a post is set to 9:45am).

    However, changing the time_format in the wp_options table to "h:i a" displays the proper time (though with a leading "0", which is no big deal).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic