Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Read-only field and datemasks

phpMyEdit General     Read-only field and datemasks
Post new topic   Reply to topic    
 
KarelB     Joined: 01 Jun 2007   Posts: 24  
Post Posted: 2008-01-30 10:19
Back to top  Reply with quote     

Hello all,

I have the following problem:
I have a date field which is read-only and should show in the Change view. So I add the option R and it behaves as I expect.

However when I try to modify the display with option 'strftimemask' the field disappears in Change view.

Here are the options i use:
'name' => 'somedate',
'select' => 'T',
'width' => 30,
'strftimemask' => '%d %b %Y',
'options' => 'LFCR',
'nowrap' => true,
'sort' => true

Remove the strftimemask option or the R and it works again.

What am i missing here.

Karel

 
myksa     Joined: 16 Oct 2007   Posts: 14  
Post Posted: 2008-01-30 10:30
Back to top  Reply with quote     

You can use

'strftimemask|LF' => '%d %b %Y'

so timemask would be applied only in list/filter modes.

 
KarelB     Joined: 01 Jun 2007   Posts: 24  
Post Posted: 2008-01-30 10:44
Back to top  Reply with quote     

Myksa, thanks for your quick response.
But I am looking for a way to format my date string in the read-only mode as well.

Is this a bug or is it designed this way?

BTW the standard MySQL date format is confusing for some people in Holland. 2008-01-02 might be interpreted as the second of Jan or the first of Feb. Hence my strftimemask option.

 
zucarino     Joined: 29 Dec 2005   Posts: 44   Location: Rio de Janeiro - Brazil
Post Posted: 2008-01-30 16:37
Back to top  Reply with quote     

KarelB wrote:
But I am looking for a way to format my date string in the read-only mode as well.


Hi KarelB,

Try this:

Code:
$opts['fdd']['field_name']['sql|CF'] = 'DATE_FORMAT(field_name, "%d %b %Y")';


Best regards!

_________________
---
Victor Zucarino
vffzbr at yahoo dot com dot br
 
KarelB     Joined: 01 Jun 2007   Posts: 24  
Post Posted: 2008-01-31 12:07
Back to top  Reply with quote     

That seems to work.
Thanks for the support.

Cheers
KArel

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy