WordPress.org

Forums

All-in-One Event Calendar
[resolved] Times displaying incorrectly on Week View (18 posts)

  1. Scott White
    Member
    Posted 3 years ago #

    I am unsure if this is a setting I missed somewhere, but I have checked that the timezone for the WordPress is correct, and it is.
    When looking at the "Week" view on the Calendar, the time list starts at 4 PM and stops at 3PM. The events that we add to the calendar have the correct time listed, but doesn't appear to show up in the right box on the actual list.
    See http://www.villagegamer.net/images/calendar_times.jpg for an example of what I mean.
    The events are showing up in the right boxes (the one listed as starting at 7 AM is in the 8th box, which would be for events starting at 7 AM) but the times listed down the far left column are way off.
    Is this a bug, or is it a setting I am not noticing somewhere?

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

  2. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    @Scott White
    wow, that's the first time I've seen such issue.

    Let's try to solve it:
    - What is the timezone in WP Settings?

  3. Scott White
    Member
    Posted 3 years ago #

    Timezone is currently set to "Vancouver", which is PST.
    The server time is currently set to "America/Vancouver". Same timezone.
    That's why I'm not sure why it would have such a discrepancy... the wordpress time actually matches the server exactly (both located in the same timezone). I'm at a loss.

  4. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    @Scott White
    Just to confirm - this the default ai1ec 1.2.2 version.
    You haven't edited or changed the plugin's source in anyway, right?

  5. Scott White
    Member
    Posted 3 years ago #

    All that I have changed is the css file (colours)

  6. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    Great, we will have to try a few cases before knowing what is going on:
    1. Can you upload the contents of app/view/week.php file from your server to wordpress.pastebin.com and give it to me?
    2. Can you upload a test.php file to the root of your wordpress and run it in your browser. The contents of test.php are:

    <?php
    require( 'wp-load.php' );
    echo esc_html( date_i18n( get_option( 'time_format', 'g a' ), gmmktime( 0, 0 ) ) );
    ?>

    Let me know the output.

    Thanks!

  7. Scott White
    Member
    Posted 3 years ago #

    The output of test.php is:
    4:00 pm

    Pastbin link is: http://pastebin.com/SKPk8t3F

  8. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    Okay, can you change the test.php file's contents to this:

    <?php
    require( 'wp-load.php' );
    echo esc_html( date_i18n( 'g a', gmmktime( 0, 0 ) ) );
    ?>

    and let me know the output

  9. Scott White
    Member
    Posted 3 years ago #

    4 pm

  10. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    Doh!
    What's the output of this:

    <?php
    echo gmdate( "M d Y H:i:s", gmmktime( 0, 0 ) );
    ?>
  11. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    and what is your PHP version?

  12. Scott White
    Member
    Posted 3 years ago #

    PHP 5.3.8 (cli) (built: Dec 30 2011 10:35:28)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    with eAccelerator v0.9.6.1, Copyright (c) 2004-2010 eAccelerator, by eAccelerator
    with the ionCube PHP Loader v4.0.9, Copyright (c) 2002-2011, by ionCube Ltd., and
    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

  13. Scott White
    Member
    Posted 3 years ago #

    Jan 10 2012 00:00:35 is the new output (sorry, didn't see you post that, only saw the php version request)

  14. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    ah great, we are getting somewhere :)
    Time for a new test, put the following content in test.php and let me know the output:
    http://pastebin.com/5LcTMvHA

  15. Scott White
    Member
    Posted 3 years ago #

    date_i18n( 'g a' ): 4 pm
    without esc_html: 4 pm
    date_i18n with gmt set: 12 am
    F j, Y g:i a : January 9, 2012 4:00 pm

  16. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    There it is!

    Edit: app/view/week.php
    Line: 93
    From: <div><?php echo esc_html( date_i18n( $time_format, gmmktime( $hour, 0 ) ) ) ?></div>
    To: <div><?php echo esc_html( date_i18n( $time_format, gmmktime( $hour, 0 ), true ) ) ?></div>

    Let me know if it solves it for you.

  17. Scott White
    Member
    Posted 3 years ago #

    Perfect! Day now starts at midnight, and works to 11:59 PM.
    Thanks for sorting that out. It was driving me bonkers

  18. Yani Iliev
    Member
    Plugin Contributor

    Posted 3 years ago #

    Awesome! You are very welcome.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • All-in-One Event Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic