Home Forums Plugin Support WP Project Manager Pro date format

This topic is: resolved

This topic contains 38 replies, has 4 voices, and was last updated by  Zoltan 4 years, 2 months ago.

Viewing 15 posts - 16 through 30 (of 39 total)
  • Author
    Posts
  • #31784

    Joanne
    Member
    Post count: 20

    Hi

    Ok I have tried

    function cpm_get_date( $date, $show_time = false ) {

    $date = strtotime( $date );

    if ( $show_time ) {
    $format = get_option( ‘date_format' ) . ‘ ‘ . get_option( ‘time_format' );
    } else {
    $format = get_option( ‘date_format' );
    }
    //$format = ‘j M, Y';
    $date_html = sprintf( ‘‘, date( ‘c', $date ), date_i18n( $format, $date ) );

    return apply_filters( ‘cpm_get_date', $date_html, $date );
    }

    DID NOT WORK

    WHen I look at my General Settings

    even though I have clicked all the settings to show LOCAL TIME – Perth Australia and
    ticked the date to show 04/12/2014 and saved BUT if I look at the other setting on the TimeZone settings on the page

    UTC time is 2014-12-04 5:35:36 Local time is 2014-12-04 13:35:36

    so the LOCAL time is still the wrong way around – is USA format

    I agree with you – until I get this GENERAL setting area to show in the WP admin

    Local time is 04-12-2014 13:35:36 – it may never work ?

    Any ideas on how to get the LOCAL time to actually appear correctly as I have ticked ALL the correct general boxes to allow it to show the changes? AND read about 100 tutorials on how this is how to do it!

    I need this fix for my client as he is sending out jobs in the to-do-list to assigned clients and the calender is telling them to working in MAY while it should be March!

    Joanne

    #31793

    Joanne
    Member
    Post count: 20

    OK I fixed the issue

    I installed a plugin called

    WP Date Range

    and set the date to read dd/mm/yyyy

    ( I also deleted the line //$format = โ€˜j M, Y'; in the functions.php and uploaded )

    now my clients are seeing Australian calender!

    Joanne

    #31794

    Joanne
    Member
    Post count: 20

    OK fixed the problem

    added this to CSS

    .cpm {
    font-size: 14px;
    line-height: 21px;
    vertical-align: baseline;
    position: relative;
    left: 50x;
    }

    I can now see al the tabs!

    Joanne

    #31799

    Alfredo
    Member
    Post count: 28

    Glad it worked for you. It did work alright for me without the extra plugin, but obviously not all installations of WordPress are created the same ๐Ÿ˜›

    Cheers, //A

    #31801

    Joanne
    Member
    Post count: 20

    guess what – it worked FINE in the back end WP dashboard BUT I just clicked on the front end and there is an fatal error on line 58 –

    Fatal error: Call to a member function get_queried_object_id() on a non-object in /home/———–/www/www/wp-includes/query.php on line 58

    so IT did fix it but them broke my site! grrrrrr when deactivate the plugin – the website opens BUT the dates are back to USA time ………………… very very frustrating … by the way – the blogs show the correct time and date format..it just this Project Manager progam that is not.

    SO back to square 1

    any ideas ?

    Joanne

    #31802

    Alfredo
    Member
    Post count: 28

    Oh dear… the only solution I can think of, as your installation seems to have so many probs and you want to have this up asap, is to do a quick-and-dirty.

    Put the line with the date format back, and change there the format to, for example, ‘j M, Y'. If the project managaer is taking over, that should change it (you may need to deactivate the extra extended date plugin, don't know.

    As I wrote in my previous one, there's the link to the WordPress codex for other date format codes, so you can specify a different one, for example ansi, or writing out the month in words, etc

    //A.

    #31804

    Joanne
    Member
    Post count: 20

    OK
    I have deleted the other plugin

    and tried

    //$format = โ€˜F j, Y';

    shows: 12/17/2014 on the calendar

    Nothing changed

    and tried

    //$format = โ€˜l, F j, Y';

    shows: 12/17/2014 on the calendar

    Nothing changed

    I am really pulling my hair out. This should be an easy fix ?

    do you know or heard of any other plugin that changes the wp admin date and time like the wp date range lugin did ?

    I am not sure why there is NOT an option to change from USA format to Australian or UK for those clients – a very obvious need.

    thank you for your help so far

    Joanne

    Joanne

    #31806

    Joanne
    Member
    Post count: 20

    I even tried changing line 151 with some PHP time stamps

    http://php.net/manual/en/class.datetime.php

    from

    function cpm_date2mysql( $date, $gmt = 0 ) {
    $time = strtotime( $date );
    return ( $gmt ) ? gmdate( ‘Y-m-d H:i:s', $time ) : gmdate( ‘Y-m-d H:i:s', ( $time + ( get_option( ‘

    to

    function cpm_date2mysql( $date, $gmt = 0 ) {
    $time = strtotime( $date );
    return ( $gmt ) ? gmdate( ‘D, d M y H:i:s O', $time ) : gmdate( ‘D, d M y H:i:s O', ( $time + ( get_option( ‘timezone_string' ) * 3600 ) ) );

    NOTHING happened

    }

    #31808

    Alfredo
    Member
    Post count: 28

    without the // before, because that comments it out, won't work

    #31809

    Alfredo
    Member
    Post count: 28

    $format = โ€˜l, F j, Y';

    #31810

    Joanne
    Member
    Post count: 20

    STILL DID NOT WORK – here is the code change

    function cpm_get_date( $date, $show_time = false ) {

    $date = strtotime( $date );

    if ( $show_time ) {
    $format = get_option( ‘date_format' ) . ‘ ‘ . get_option( ‘time_format' );
    } else {
    $format = get_option( ‘date_format' );
    }
    $format = ‘l, F j, Y';
    $date_html = sprintf( ‘‘, date( ‘c', $date ), date_i18n( $format, $date ) );

    return apply_filters( ‘cpm_get_date', $date_html, $date );
    }

    I also wonder would this PHP script need to change as you can see some wrong date codes showing USA time

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

    J

    #31814

    Alfredo
    Member
    Post count: 28

    sorry, just tested and works perfectly for me changing the date format in functions.php – so either it's something conflicting there, not in the project manager pro plugin but somewhere else… can't see what else could be done, apart from waiting for wedevs support and give them your login and ftp so they can test themselves…

    //A

    #31817

    Joanne
    Member
    Post count: 20

    – I am starting to turn off all the plugins now – to see if there is a conflict

    do you see your date as 4/11/2014 or 4.11.2014 format ?

    thank you for all your kind suggestions – just a pitty the work around did not work for me

    take care

    j

    #31819

    Alfredo
    Member
    Post count: 28

    My date changes to whatever i put in the code, so it works for me. On the other hand, if i comment out the date format in functions.php, wordpress custom settings take over, and that's what I actually use

    If you manage to fix it, don't forget to post the how, why and wherefores. It'll help others (and the developers too)

    Best, and good luck. /A.

    #31820

    Joanne
    Member
    Post count: 20

    it strange how the data against the TO DO LIST is written correctly after I add it –

    Sub Title B 2 Comments Joanne J Smith Wednesday, December 3, 2014 – Wednesday, December 31, 2014 [21%]

    HOWEVER when you click on the Calender to pick a ‘start date' and ‘end date' it is in USA date so the question is – did the coding correct the date to AUstralian Time in written format BUT I need to now change something else to make the LIVE calender look correct as when you pick the date it show in the box start boc 12/4/2014 and end box 57/6/2014

    ………………

    Am I looking at 2 different issues ?

    ALSO I turned off every plugin and picked another standard template and that did not change the calander picker part

    now I am really confusing myself —— calender picker is wrong BUT the printed text results is correct

    what do you see when you click on the calender ?

    Joanne

Viewing 15 posts - 16 through 30 (of 39 total)

The topic ‘date format’ is closed to new replies.