PEAK XOOPS - How can i change date-time format? in englishin japanese

How can i change date-time format?

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 .2 | Posted on 2004/1/19 1:07
isorokin  ÆóÅùʼ From: Russia, Moscow  Posts: 4
How can i change date-time format? In Russia it is "dd.mm.yyyy"?
Votes:8 Average:6.25
Previous post - Next post | Parent - Children.1 | Posted on 2004/1/22 11:44
GIJOE  ÀèǤ·³Áâ   Posts: 4110
Quote:
isorokin wrote:
How can i change date-time format? In Russia it is "dd.mm.yyyy"?
It is defined in langauage files.
You should edit language/russian/pical_constants.php
The constant is either of
_PICAL_STRFFMT_DATE or
_PICAL_STRFFMT_DATE_FOR_BLOCK or
_PICAL_FMT_YMD or
_PICAL_FMT_YMDO
Votes:9 Average:3.33
Previous post - Next post | Parent - Children.1 | Posted on 2004/1/23 4:27
isorokin  ÆóÅùʼ From: Russia, Moscow  Posts: 4
Can i change date-time format for "index.php?action=Edit", for example, i want enter data in field "Beginning DateTime" not in "yyyy-mm-dd", but in "dd.mm.yyyy"?
Votes:11 Average:4.55
Previous post - Next post | Parent - No child | Posted on 2004/1/23 5:23
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi isorokin.

The textbox in editting view only supports ISO format because JavaScript Calendar only supports ISO format.

If you and your site guests never use JavaScript Calendar, it is easy to change the format.
Votes:8 Average:2.50
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/10 1:43
technigrafa  ÆóÅùʼ   Posts: 5
I am using piCal 0.8 and I want to change the date format in two places:

The Upcoming Events block, I want to change "9th Mar" to "March 9th 2006"

And in the detail view I want to change "12th July 2006 Wednesday" to "Wednesday July 12th, 2006"

I have been digging around as I thought this would be an easy fix, but I am over my head.

HELP!
Votes:11 Average:4.55
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/10 14:54
GIJOE  ÀèǤ·³Áâ   Posts: 4110
Though I don't remember such features in correct, you can do that just by editing language files.

edit language/(your_language)/pical_constants.php

eg) for the 2nd request:
// definition of orders     Y:year  M:month  W:week  D:day  N:dayname  O:operand
define('_PICAL_FMT_MD','%2$s %1$s') ;
define('_PICAL_FMT_YMD','%3$s %2$s %1$s') ;
define('_PICAL_FMT_YMDN','%3$s %2$s %1$s %4$s') ; // <- modify here
define('_PICAL_FMT_YMDO','%4$s%3$s%2$s%1$s') ;
define('_PICAL_FMT_YMW','%3$s %2$s %1$s') ;
define('_PICAL_FMT_YW','WEEK%2$s %1$s') ;
define('_PICAL_FMT_DHI','%1$s %2$s:%3$s') ;
define('_PICAL_FMT_HI','%1$s:%2$s') ;


Votes:12 Average:5.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/10 21:43
technigrafa  ÆóÅùʼ   Posts: 5
Ah! Thanks! In case anyone wants to know, I changed:

define('_PICAL_FMT_YMDN','%3$s %2$s %1$s %4$s') ;

to:

define('_PICAL_FMT_YMDN','%4$s %2$s %3$s %1$s') ;

That affected the "Detail Vew."

AND change:

define('_PICAL_FMT_MD','%2$s %1$s') ;

to

define('_PICAL_FMT_MD','%1$s %2$s') ;

...to reverse the order in the "Upcoming Events" block. Although I couldn't get it to display the year there. Oh well, this is good for now.
Votes:26 Average:3.46
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/11 4:53
GIJOE  ÀèǤ·³Áâ   Posts: 4110
Edit piCal_xoops.php after the line 425.
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/6/15 2:03
technigrafa  ÆóÅùʼ   Posts: 5
Thanks! I have another question. I am trying to change the time display for the detail view to show the time as "8:30 AM", rather than "AM 8:30."

I dug around in the english language file, but nothing seemes to change that. the AM/PM seems to be tied to the hour variable. For example, I can make it say "30 AM 8:" but not move the AM to after the minutes. Where do I adjust that? I tried looking in piCal_xoops.php as well, but there's so much in there I couldn't find anything relating to that.

Also, I was wondering if there were plans to add notifications so that users will be notified when the event happens, or is one day/week away? Maybe that is already available?

Thanks again!
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/6/17 5:42
GIJOE  ÀèǤ·³Áâ   Posts: 4110
It should be into my TODO.

You have to edit class/piCal.php in the current version.

eg)
line 2673 of piCal.php
function get_middle_hi( $time , $is_over24 = false )
{
	$hour_offset = $is_over24 ? 24 : 0 ;

	$hour4disp = $this->use24 ? $this->hour_names_24[ date( 'G' , $time ) + $hour_offset ] : $this->hour_names_12[ date( 'G' , $time ) + $hour_offset ] ;

	return sprintf(
		_PICAL_FMT_HI ,
		$hour4disp , // H
		date( _PICAL_DTFMT_MINUTE , $time ) // I
	) ;
	
	return date( "g:i A" , $time ) ;
}

Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2006/6/19 22:24
technigrafa  ÆóÅùʼ   Posts: 5
Thanks!

That worked like a charm!
Votes:0 Average:0.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!