[Koha-cvs] CVS: koha/C4 Date.pm,1.8,1.9

Mike Hansen wolfpac444 at users.sourceforge.net
Sat Mar 29 01:03:05 CET 2003


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1:/tmp/cvs-serv3275/koha/C4

Modified Files:
	Date.pm 
Log Message:
Bug fixes


Index: Date.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Date.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** Date.pm	28 Mar 2003 23:08:30 -0000	1.8
--- Date.pm	29 Mar 2003 00:02:29 -0000	1.9
***************
*** 1,2 ****
--- 1,4 ----
+ #!/usr/bin/perl -w
+ 
  package C4::Date;
  
***************
*** 16,22 ****
               &display_date_format
               &format_date
-              &format_date_in_iso
  );
  
  sub get_date_format
  {
--- 18,25 ----
               &display_date_format
               &format_date
  );
  
+ 
+ 
  sub get_date_format
  {
***************
*** 66,70 ****
  	if ( $dateformat eq "us" )
  	{
- 		Date_Init("DateFormat=US");
  		$olddate = ParseDate($olddate);
  		$newdate = UnixDate($olddate,'%m/%d/%Y');
--- 69,72 ----
***************
*** 72,76 ****
  	elsif ( $dateformat eq "metric" )
  	{
- 		Date_Init("DateFormat=metric");
  		$olddate = ParseDate($olddate);
  		$newdate = UnixDate($olddate,'%d/%m/%Y');
--- 74,77 ----
***************
*** 78,82 ****
  	elsif ( $dateformat eq "iso" )
  	{
- 		Date_Init("DateFormat=iso");
  		$olddate = ParseDate($olddate);
  		$newdate = UnixDate($olddate,'%Y-%m-%d');
--- 79,82 ----
***************
*** 88,123 ****
  }
  
- sub format_date_in_iso
- {
-         my $olddate = shift;
-         my $newdate;
-                 
-         my $dateformat = get_date_format();
- 
-         if ( $dateformat eq "us" )
-         {
-                 Date_Init("DateFormat=US");
-                 $olddate = ParseDate($olddate);
-         }
-         elsif ( $dateformat eq "metric" )
-         {
-                 Date_Init("DateFormat=metric");
-                 $olddate = ParseDate($olddate);
-         }
-         elsif ( $dateformat eq "iso" )
-         {
-                 Date_Init("DateFormat=iso");
-                 $olddate = ParseDate($olddate);
-         }
-         else
-         {
-                 return "9999-99-99";
-         }
- 
- 	$newdate = UnixDate($olddate, '%Y-%m-%d');
- 
- 	return $newdate;
- }
- 
  1;
- __END__
--- 88,90 ----





More information about the Koha-cvs mailing list