--- loncom/interface/lonhtmlcommon.pm 2010/11/08 23:27:58 1.253.2.5 +++ loncom/interface/lonhtmlcommon.pm 2010/11/29 04:40:12 1.253.2.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.253.2.5 2010/11/08 23:27:58 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.253.2.6 2010/11/29 04:40:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -410,7 +410,7 @@ The method used to restrict user input w ############################################## sub date_setter { my ($formname,$dname,$currentvalue,$special,$includeempty,$state, - $no_hh_mm_ss,$defhour,$defmin,$defsec,$nolink) = @_; + $no_hh_mm_ss,$defhour,$defmin,$defsec,$nolink,$hide_timezone) = @_; my $now = time; my $wasdefined=1; if (! defined($state) || $state ne 'disabled') { @@ -563,7 +563,10 @@ ENDJS $cal_link = qq{}; } # - my $tzone = ' '.$tzname.' '; + my $tzone; + unless ($hide_timezone) { + $tzone = ' '.$tzname.' '; + } if ($no_hh_mm_ss) { $result .= &mt('[_1] [_2] [_3] ', $monthselector,$dayselector,$yearselector). @@ -643,7 +646,7 @@ Returns: Unix time represented in the fo ############################################## ############################################## sub get_date_from_form { - my ($dname) = @_; + my ($dname,$timezone) = @_; my ($sec,$min,$hour,$day,$month,$year); # if (defined($env{'form.'.$dname.'_second'})) { @@ -693,7 +696,11 @@ sub get_date_from_form { if (($year<1970) || ($year>2037)) { return undef; } if (defined($sec) && defined($min) && defined($hour) && defined($day) && defined($month) && defined($year)) { - my $timezone = &Apache::lonlocal::gettimezone(); + if (defined($timezone)) { + if (&Apache::lonlocal::gettimezone($timezone) eq 'local') { + $timezone = &Apache::lonlocal::gettimezone(); + } + } my $dt = DateTime->new( year => $year, month => $month, day => $day,