date format

This topic contains 38 reply and 4 voices, and was last updated by Zoltan 10 years ago
Viewing 15 Posts - 1 through 15 (of 38 total)
Author Posts
July 14, 2014 at 4:18 pm 23515
Zoltan I'm starting to use this plugin and I see that the date format is American (month/day/year). It's abit confusing for us non-American, and it doesn't follow the default chosen in wordpress settings. It looks like an implementation of datepicker, so it should be editable somewhere. Anything I could do about this? Cheers, Alfredo
July 15, 2014 at 5:04 am 23573
Sekander Badsha Sekander Badsha

Hi Alfredo,
Can you please tell me,
1. Where is the date being displayed?
2. How the input for date coming? Like you’re inserting a date to display ? or are you talking about the default post date ?

July 15, 2014 at 12:44 pm 23587
Alfredo Alfredo

Hi Sekander,

the problem is everywhere (projects, to-do, etc) there is a date to be picked or edited (click on the field, ‘due date’ for example and the datepicker calendar shows up) and the date to be edited shows as mm/dd/yyyy. This is confusing if everybody is using either ansi-is yyyy/mm/dd or dd/mm/yyyy.

It’s consistent, it simply has its own default, doesn’t take the WordPress settings and doesn’t have an option in its own settings.

Calendar of course has the week beginning on the wrong day, but I’ve seen in the forum it’s something coming in the next version.

This seems to be controlled from one file. If you point me in the right direction I really don’t mind editing PHP to correct this.

July 16, 2014 at 2:07 pm 23649
Sekander Badsha Sekander Badsha

Hello Alfredo,

Open functions.php which is located at “\wp-content\plugins\wedevs-project-manager\includes\” and go to line number 252 and you will see something like $format = 'M j, Y';. Comment that line out.
So it’d look like // $format = 'M j, Y';

Let me know if you feel any difficulty.

July 16, 2014 at 3:43 pm 23653
Alfredo Alfredo

Perfect! That fixed it so WPress date format settings come through on the display part and front-end

1. Now, where to fix the edit field? It would be nice so that could show the same format (all edit fields where you determine for example, ‘due date’ for a task, milestone, etc.)

2. You say the starting day of the week will be fixed in the next update? If so I could try and edit myself the calendar addon, as it won’t matter if it gets replcaed at the next update, Would taht be in fullcalendar.min.js?

July 16, 2014 at 4:47 pm 23660
Alfredo Alfredo

AH, please disregard question #2, I’ve fixed that now.

For those interested:

The file in question is the jQuery fullCalendar, fullcalendar.min.js found in
wp-content/plugins/wedevs-project-manager-pro/assets/js

it’s minified, so it’s a bit of a pain to edit, but not lethal 😉
and make a backup of it before changing, of course

First day of the week
———————–
You want to change the value of firstDay to 1:
firstDay:1

as a bonus, I also changed so the calendar shows the week number (I live in Sweden and everything, from manufacturing to public administration to schools, is scheduled by week number)

Week numbering
———————–
you want to change the value of weekNumbers to !0:
weekNumbers:!0

documentation at:
http://arshaw.com/fullcalendar/docs/display/

Cheers,
Alfredo

July 17, 2014 at 1:29 pm 23701
Sekander Badsha Sekander Badsha

Thanks for being awesome and posting the solution 🙂

July 20, 2014 at 2:23 pm 23800
Alfredo Alfredo

No worries, happy to contribute, I had seen a couple of guys had asked the same question already 🙂

By the way, you have marked this issue as ‘Resolved’, but it actually isn’t, only question #2. I still can’t find where to edit for changing date format in the editing fields – which was question #1

Cheers, /A.

July 21, 2014 at 5:43 pm 23874
Sekander Badsha Sekander Badsha

On your third post, you said that the solution worked and then you’ve got some more questions and those were solved too. So that’s why I marked this topic as resolved.

The issue you’re talking about is only a temporary issue. Its just showing on the input field. But after submitting the date format is just like you have chosen in the WordPress Settings. So that’s not a big thing. And moreover, changing that could cause some issues. So we decided not to change that. I hope you’ll understand.

December 3, 2014 at 9:25 pm 31732
Joanne Joanne

Hi

I changed the functions file BUT nothing changed – I have tried it every which way

what is the Exact line of code in the PHP script because what you said looks exactly the same if

$format = ‘M j, Y’;. Comment that line out
and replace with $format = ‘M j, Y’;

if I delete the line $format = ‘M j, Y’;. Comment that line out and replace with
// $format = ‘M j, Y’;

I get a broken script error message

I am in Australia and I really need the calander to look correct as 3/5/2014 is not 5th march but should read 3rd of may if it was australian time.

appricate any help fast as it is live on a clients site

Joanne

December 3, 2014 at 10:57 pm 31739
Alfredo Alfredo

Hi Joanne,

what I did is just follow the instructions given by Sekander. Comment out the line. The line should look like this:
// $format = 'M j, Y';
maybe the blank space between // and $ is important in PHP and it’s why you error out…

Then, when that line is no longer interfering, just define the date format as you want it inside wordpress settings.

Cheers, //A

December 3, 2014 at 11:20 pm 31741
Joanne Joanne This reply has been marked as private.
December 3, 2014 at 11:22 pm 31742
Joanne Joanne This reply has been marked as private.
December 4, 2014 at 12:07 am 31745
Alfredo Alfredo

Hi Joanne,

1) a couple of small things. I’m not a member of wedevs, just another user like you. If you mark your replies as ‘private’ you’ll have to wait until the guys in Bangladesh wake up, and nobody else in the support forum will be able to chip in with their knowledge/experience (I still can see your answers because I saterted this thread andI receive them as email)

2) if you don’t get any error, then you should go to wordpress settings and change the format there. As long as that line is commented out (or simply delete it, as Sekander proposes), then it won’t interfere with wordpress own settings.

3) Be sure that not just the time is set to local Perth, but the format as well, which is a separate setting (I suspect that may be causing the issue)

4) If nothing else helps, then I guess you could use brute force, and restore the problematic line in functions.php, only change ti to the format you want. For example, UK format: ‘j M, Y’

a full format code reference is in the wordpress codex (you can use this too in the date format settings, custom, in wordpress): http://codex.wordpress.org/Formatting_Date_and_Time

Hope it helps. Cheers //A.

December 4, 2014 at 11:17 am 31777
Joanne Joanne

Which line of CSS do I change to indent it ?

is the correct line
.cpm {

to be

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

thanks

joanne

weDevs Team wrote:

December 4, 2014 at 11:45 am 31784
Joanne Joanne

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

Viewing 15 Posts - 1 through 15 (of 38 total)