1
reddshack
formdatetime.php & calendar.js
  • 2005/4/4 10:54

  • reddshack

  • Just popping in

  • Posts: 15

  • Since: 2005/3/31


-formdatetime.php
#1 - Is there any way or hack to change this (or possibly a different file) so that time options will be listed in 12 hour format with AM and PM in the picklist?

In my forms for submitting news and other things (extcal, etc.), I'm afraid that some of my users are illiterate to 24 hour time format, and 12 hour format would be much better suited. Is this a possible feature that I could input?

-calendar.js
#2 - Also, will the new XOOPS release's be implementing the new calendar.js from http://www.dynarch.com/ ? They released v1.0 not too long ago and it has some great bug fixes.

2
reddshack
Re: formdatetime.php & calendar.js
  • 2005/4/6 7:36

  • reddshack

  • Just popping in

  • Posts: 15

  • Since: 2005/3/31


Bump

Any ideas of anything that could be remotely close? If it
can't be done, just say so

3
reddshack
Re: formdatetime.php & calendar.js
  • 2005/4/8 1:21

  • reddshack

  • Just popping in

  • Posts: 15

  • Since: 2005/3/31


I'll take the response that nobody knows then. Good luck to anyone else that ever has this problem.... there's seems to be no solution.

4
Chado
Re: formdatetime.php & calendar.js
  • 2005/4/8 2:54

  • Chado

  • Not too shy to talk

  • Posts: 113

  • Since: 2003/6/6 7


If I understand what you are asking...I think you just need to edit the date format section of the global.php file in your language folder. See this post for details.

Making this an option in the admin section would be a big timesaver. Just a thought for the future....

5
reddshack
Re: formdatetime.php & calendar.js
  • 2005/4/8 3:19

  • reddshack

  • Just popping in

  • Posts: 15

  • Since: 2005/3/31


Thanks for the input, but it's a little different of a problem though. Try submitting something with a form that has a specified start time or time listing, such as a News or something with ExtCal. Look where it says start time and end time. Open up the picklist and you will see it has 0 - 23 with intervals of 10 on each adding up the time.

So it displays: 0:10, 0:20, 0:30 ..... 18:40, 18:50, 19:00.

It would be much nicer to have these listed in 12 hour am pm format. Any idea?

EDIT: Here's the ORIGINAL code found in "formdatetime.php" inside of 'class'-->'xoopsform' that is responsible for creating this 24 hour mode listing. IMO this is where the change needs to take place, but what needs to be changed?

class XoopsFormDateTime extends XoopsFormElementTray
{

    function 
XoopsFormDateTime($caption$name$size 15$value=0)
    {
        
$this->XoopsFormElementTray($caption' ');
        
$value intval($value);
        
$value = ($value 0) ? $value time();
        
$datetime getDate($value);
        
$this->addElement(new XoopsFormTextDateSelect(''$name.'[date]'$size$value));
        
$timearray = array();
        for (
$i 0$i 24$i++) {
            for (
$j 0$j 60$j $j 10) {
                
$key = ($i 3600) + ($j 60);
                
$timearray[$key] = ($j != 0) ? $i.':'.$j $i.':0'.$j;
            }
        }
        
ksort($timearray);
        
$timeselect = new XoopsFormSelect(''$name.'[time]'$datetime['hours'] * 3600 600 ceil($datetime['minutes'] / 10));
        
$timeselect->addOptionArray($timearray);
        
$this->addElement($timeselect);
    }
}

How can I make this list 12 hour with am and pm?

Login

Who's Online

169 user(s) are online (100 user(s) are browsing Support Forums)


Members: 0


Guests: 169


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits