Home Forums Plugin Support WP Project Manager – Free Date Picker Not Working

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  Tareq Hasan 6 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1693

    hmmcreative
    Participant
    Post count: 5

    When I pick a date for a milestone or task, the date changes to the day before upon saving. This happens in both the admin and front-end pages. If I go back to edit the date, it will not let me pick a new date, but rather I have to type in the date manually and upon saving, it still shows the wrong date.

    I also have an issue with the date picker when editing a milestone. If I hit the arrow to go to the next month, it shows January 1900 as the year. Again this happens on both the admin and front-end pages.

    Any ideas on how to fix this? Perhaps there is a date picker compatibility issue? I'm using WP version 3.5.1 and project manager 0.4.2, and the front-end version 1.1.

    I really like your plugin and would like to use this!

    #1942

    hmmcreative
    Participant
    Post count: 5

    I've been doing some research and looking into your code. I solved the first problem I have where the milestones change upon saving to the previous date. This also occurred when saving tasks. I found that your function cpm_date2mysql was where the date is converted to a timestamp and saved in the database for both the milestones and tasks. I changed the following $gmt value from o to 1 and it now writes the correct date upon saving both milestones and tasks.

    File is functions.php line 97:

    function cpm_date2mysql( $date, $gmt = 1 ) {
    $time = strtotime( $date );
    return ( $gmt ) ? date( ‘Y-m-d H:i:s', $time ) : date( ‘Y-m-d H:i:s', ( $time + ( get_option( ‘gmt_offset' ) * 3600 ) ) );
    }

    #1962

    Tareq Hasan
    Keymaster
    Post count: 2831

    Hmm, interesting. May be your servers time is different than your sites configured date and that way the problem comes in. I've to test more. Glad to know that works for you ๐Ÿ™‚

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Date Picker Not Working’ is closed to new replies.