WordPress.org

Ready to get started?Download WordPress

Forums

WP Job Manager
How many days ago is incorrect (13 posts)

  1. Sebastien Dumont
    Member
    Posted 8 months ago #

    I have noticed that there is an error when displaying how many days ago the job was posted. I have a job that was posted on the 3rd August and today I see it says it was only posted 2 days ago.

    http://jobs.sebs-studio.com/job/new-website-logo-and-mascot-needed/

    This is very confusing. Does any one else have this problem ? I am using the latest version of the plugin and I am on WordPress version 3.6

    http://wordpress.org/plugins/wp-job-manager/

  2. mikejolley
    Member
    Plugin Author

    Posted 8 months ago #

    Not sure why this would happen - this is the code:

    human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ) . ' ' . __( 'ago', 'job_manager' )

    get_the_time should return the publish date.

  3. Sebastien Dumont
    Member
    Posted 8 months ago #

    I just gone to the job post again on my site. Now it is showing it correctly. It says posted 2 weeks ago. I have not made any modifications to the plugin, WordPress or job post.

    It just decided to change from 2 days ago to 2 weeks ago.

    Could this be a miss-calculation in WordPress it's self of version 3.6 ?

    I will check again in a few hours to see if it stays the same now or not.

  4. chtrede
    Member
    Posted 6 months ago #

    Hi "Plugin Author",

    having a similar problem. Posted a job some minutes ago and it shows me as the posted date "44 years ago (44 Jahre her)".... a bug! Tried it with a new posting a minute ago and it also shows 44 years ago.

    Check http://www.hitradio.com.na/uber-uns/jobs/

    Any solution?

    Best regards
    Christian

  5. mikejolley
    Member
    Plugin Author

    Posted 6 months ago #

    @chtrede whats the post date when you edit the listing? And if thats wrong, did you submit the listing, or manually post it.

  6. chtrede
    Member
    Posted 6 months ago #

    Hi mikejolley,

    the edit date is the correct date and time.
    I manually posted it from backend.

    Regards
    Christian

  7. mikejolley
    Member
    Plugin Author

    Posted 6 months ago #

    I'm not sure what to suggest - I don't see this happening for other users so it would have to be a plugin or theme affecting it. We use the standard get_the_time() function which should return correctly for the current post.

    Perhaps turn off themes and plugins, then turn them on until the issue occurs so you know whats doing it.

  8. chtrede
    Member
    Posted 6 months ago #

    Hi there,

    tried it, makes no difference with all plugins deactivated and even with another theme. Do not have any date issues with any other plugin.

    Could you then maybe just point me to the correct file and which lines to delete so that no date/time at all is shown!

    Many thanks
    Christian

  9. mikejolley
    Member
    Plugin Author

    Posted 6 months ago #

    here: https://github.com/mikejolley/WP-Job-Manager/blob/master/templates/content-job_listing.php#L16

    Maybe you could debug that too:

    <?php
    global $post;
    var_dump( $post->post_date );
    var_dump( get_the_time( 'U' ) );
    var_dump( date( 'Y-m-d', get_the_time( 'U' ) ) );
    var_dump( date( 'Y-m-d', current_time( 'timestamp' ) ) );
    ?>

    That will output some data from the post - see which is output correctly/incorrectly :)

  10. chtrede
    Member
    Posted 6 months ago #

    Hi there,

    in wp-job-manager/templates/content-job_listing.php
    the mentioned code does not exist.

    all that related there to a date is
    <li class="date"><date><?php echo human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ) . ' ' . __( 'ago', 'job_manager' ); ?></date></li>

    Regards
    Christian

  11. mikejolley
    Member
    Plugin Author

    Posted 6 months ago #

    @chtrede I know it doesn't exist, I was suggesting that you add it to see which date is being pulled incorrectly.

  12. chtrede
    Member
    Posted 6 months ago #

    Ok, do not know how to debug or so, as I am not a computer expert at all. Thought there is a way to get rid of the wrong time/date...

    Anyways, will use another lugin then.

    Thanks
    Christian

  13. mikejolley
    Member
    Plugin Author

    Posted 6 months ago #

    Removing the list element would have sufficed.

    Of course, doing debug as I suggested (pasting the code, seeing what is output, then removing the code again) would have helped reveal the issue *that is specific to your site* but suit yourself.

    Thanks

Reply

You must log in to post.

About this Plugin

About this Topic

Tags