Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 30. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Sort by day help !!

phpMyEdit Configuration     Sort by day help !!
Odoslať novú tému   Odpovedať na tému    
 
yougi77     Založený: 03.09.2007   Príspevky: 1  
Príspevok Zaslal: 2007-09-03 18:28
Návrat hore  Odpovedať s citátom     

Hi, I come from France, I use phpMyEdit for a dynamic planning.

For the week days, I have "Lundi, Mardi, Mercredi, Jeudi, Vendredi, Samedi, Dimanche". (= Monday, Tuesday, Wednesday etc..)

In my mysql table, I have a key called "Jours" (=Days).
When I click on it, it sorts by the alphabetical way but I don't want to.
I.E I have "Dimanche, Jeudi, Lundi, Mardi, Mercredi, Samedi, Vendredi" (= Sunday, Thursday, Monday etc..)

Any idea for fixing it ?
(Sorry for my english)

 
ajh     Založený: 17.12.2003   Príspevky: 236  
Príspevok Zaslal: 2007-09-05 17:36
Návrat hore  Odpovedať s citátom     

Have a calculated field with a day of week number (1-7 maybe) and sort by that?

 
EoN     Založený: 06.09.2007   Príspevky: 3  
Príspevok Zaslal: 2007-09-07 03:04
Návrat hore  Odpovedať s citátom     

I have a similar question on this topic - any help would be greatly appreciated:

On my LIST page, I have included 'sql' to perform mysql DATE_FORMAT function to format it in a nice way. The problem is, when I sort by this column, it sorts by the string value rather than the actual date. (for example, '23 Jan 07' is seen to be HIGHER than '20 Dec 07' because it sorts by string, rather than date value)

Is there some way to have the Formatted Date display, but have the same column SORT BY the INTERNAL database DATE format???

Here is the column I have:

Kód:

$opts['fdd']['signup_date'] = array(
  'name'     => 'Joined',
  'select'   => 'T',
  'maxlen'   => 19,
  'default'  => '0000-00-00 00:00:00',
  'sort'     => true,
  'sql'       => 'DATE_FORMAT(signup_date, \'%d %b %y %l:%i %p\')'
);


 
derick     Založený: 23.08.2007   Príspevky: 4  
Príspevok Zaslal: 2007-09-07 17:42
Návrat hore  Odpovedať s citátom     

Eon,

I also work with dates - here is what I simply use : in mysql, field 'Mydate' is a classic 'date' type. In PME, I say :
Kód:
$opts['fdd']['MyDate']['datemask'] = 'd/m/y'
.
Sort & store are OK ... Derick

 
EoN     Založený: 06.09.2007   Príspevky: 3  
Príspevok Zaslal: 2007-09-10 00:16
Návrat hore  Odpovedať s citátom     

Thanks Derick, I hadn't tried datemask. That works perfectly :)

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov