[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Date.pm,1.5,1.6
From: |
Mike Hansen |
Subject: |
[Koha-cvs] CVS: koha/C4 Date.pm,1.5,1.6 |
Date: |
Tue, 25 Mar 2003 20:44:12 -0800 |
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1:/tmp/cvs-serv17121/koha/C4
Modified Files:
Date.pm
Log Message:
Index: Date.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Date.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** Date.pm 26 Mar 2003 04:42:56 -0000 1.5
--- Date.pm 26 Mar 2003 04:44:10 -0000 1.6
***************
*** 18,25 ****
&display_date_format
&format_date
);
-
sub get_date_format
{
--- 18,25 ----
&display_date_format
&format_date
+ &format_date_in_iso
);
sub get_date_format
{
***************
*** 69,72 ****
--- 69,73 ----
if ( $dateformat eq "us" )
{
+ Date_Init("DateFormat=US");
$olddate = ParseDate($olddate);
$newdate = UnixDate($olddate,'%m/%d/%Y');
***************
*** 74,77 ****
--- 75,79 ----
elsif ( $dateformat eq "metric" )
{
+ Date_Init("DateFormat=metric");
$olddate = ParseDate($olddate);
$newdate = UnixDate($olddate,'%d/%m/%Y');
***************
*** 79,82 ****
--- 81,85 ----
elsif ( $dateformat eq "iso" )
{
+ Date_Init("DateFormat=iso");
$olddate = ParseDate($olddate);
$newdate = UnixDate($olddate,'%Y-%m-%d');
***************
*** 88,90 ****
--- 91,124 ----
}
+ 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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Date.pm,1.5,1.6,
Mike Hansen <=
- Prev by Date:
[Koha-cvs] CVS: koha/opac opac-moredetail.pl,1.4,1.5 opac-reserve.pl,1.12,1.13 opac-user.pl,1.8,1.9 opac-userdetails.pl,1.5,1.6 opac-userupdate.pl,1.9,1.10
- Next by Date:
[Koha-cvs] CVS: koha/koha-tmpl/opac-tmpl/default/en opac-user.tmpl,1.8,1.9
- Previous by thread:
[Koha-cvs] CVS: koha/opac opac-moredetail.pl,1.4,1.5 opac-reserve.pl,1.12,1.13 opac-user.pl,1.8,1.9 opac-userdetails.pl,1.5,1.6 opac-userupdate.pl,1.9,1.10
- Next by thread:
[Koha-cvs] CVS: koha/koha-tmpl/opac-tmpl/default/en opac-user.tmpl,1.8,1.9
- Index(es):