Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.253.2.5 and 1.253.2.6

version 1.253.2.5, 2010/11/08 23:27:58 version 1.253.2.6, 2010/11/29 04:40:12
Line 410  The method used to restrict user input w Line 410  The method used to restrict user input w
 ##############################################  ##############################################
 sub date_setter {  sub date_setter {
     my ($formname,$dname,$currentvalue,$special,$includeempty,$state,      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 $now = time;
     my $wasdefined=1;      my $wasdefined=1;
     if (! defined($state) || $state ne 'disabled') {      if (! defined($state) || $state ne 'disabled') {
Line 563  ENDJS Line 563  ENDJS
         $cal_link = qq{<a href="javascript:$dname\_opencalendar()">};          $cal_link = qq{<a href="javascript:$dname\_opencalendar()">};
     }      }
     #      #
     my $tzone = ' '.$tzname.' ';      my $tzone;
       unless ($hide_timezone) {
           $tzone = ' '.$tzname.' ';
       }
     if ($no_hh_mm_ss) {      if ($no_hh_mm_ss) {
         $result .= &mt('[_1] [_2] [_3] ',          $result .= &mt('[_1] [_2] [_3] ',
                        $monthselector,$dayselector,$yearselector).                         $monthselector,$dayselector,$yearselector).
Line 643  Returns: Unix time represented in the fo Line 646  Returns: Unix time represented in the fo
 ##############################################  ##############################################
 ##############################################  ##############################################
 sub get_date_from_form {  sub get_date_from_form {
     my ($dname) = @_;      my ($dname,$timezone) = @_;
     my ($sec,$min,$hour,$day,$month,$year);      my ($sec,$min,$hour,$day,$month,$year);
     #      #
     if (defined($env{'form.'.$dname.'_second'})) {      if (defined($env{'form.'.$dname.'_second'})) {
Line 693  sub get_date_from_form { Line 696  sub get_date_from_form {
     if (($year<1970) || ($year>2037)) { return undef; }      if (($year<1970) || ($year>2037)) { return undef; }
     if (defined($sec) && defined($min)   && defined($hour) &&      if (defined($sec) && defined($min)   && defined($hour) &&
         defined($day) && defined($month) && defined($year)) {          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,          my $dt = DateTime->new( year   => $year,
                                 month  => $month,                                  month  => $month,
                                 day    => $day,                                  day    => $day,

Removed from v.1.253.2.5  
changed lines
  Added in v.1.253.2.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>