Configurable Reports and the 'Date format profile field'

Configurable Reports and the 'Date format profile field'

by John Samuel -
Number of replies: 8

Greetings happy moodlers,

Qucik question! i am using a new profile field 'Date Format'  here http://tracker.moodle.org/browse/MDL-24806?focusedCommentId=143330#comment-143330 but the configurable reports block doesn't show the date as a date. it just shows bunch of numbers. can you please assist on how to make your block show it as date and export it as date.

 Thanks

Average of ratings: -
In reply to John Samuel

Re: Configurable Reports and the 'Date format profile field'

by Kimber Warden -

If you're writing the SQL query yourself (on the SQL tab) you can use DATE_FORMAT(fieldname, '%M %d, %Y') to display it like, "February 8, 2012"

In reply to Kimber Warden

Re: Configurable Reports and the 'Date format profile field'

by John Samuel -

Thank you Kimber but what if i want to use a user-report instead ?

when i pick user profile field = date it shows bunch of numbers...

In reply to John Samuel

Re: Configurable Reports and the 'Date format profile field'

by John Samuel -

Example i set the permission to see the report to; profile field Date = 01/01/2010 and it doesn't work because it doesn't read the date field as a date field.

I hope Juan can assist here smile

Thank you

In reply to John Samuel

Re: Configurable Reports and the 'Date format profile field'

by Kimber Warden -

Sorry, I'm afraid I can't help you there. I only know how to format a date using MySQL. Hopefully someone else will chime in.

In reply to John Samuel

Re: Configurable Reports and the 'Date format profile field'

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi John,

currently my plugin doesn't support this type of new profile fields

I think that if you modify this file:

https://github.com/jleyva/moodle-block_configurablereports/blob/MOODLE_21_STABLE/components/columns/userfield/plugin.class.php#L55

And add something like:

if($p->datatype == 'datetime'){

$p->data = userdate($p->data)

}

It will work

In reply to Juan Leyva

Re: Configurable Reports and the 'Date format profile field'

by John Samuel -

Hi Juan,

it worked beautifully nice but it's showing me '%Y/%m/%d' and %Hour

how do i get it to show just '%Y/%m/%d'?

Thank you

In reply to John Samuel

Re: Configurable Reports and the 'Date format profile field'

by John Samuel -

nevermind i found this one

In reply to John Samuel

Re: Configurable Reports and the 'Date format profile field'

by Steven Swanson -

Where did you find it? I'm looking to change the same thing?