MT 2068 : Fixed scheduling guided reports
authorMatthias Meusburger <matthias.meusburger@biblibre.com>
Fri, 16 Oct 2009 09:03:27 +0000 (11:03 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Fri, 16 Oct 2009 09:30:58 +0000 (11:30 +0200)
tools/scheduler.pl

index e985bd3..5fae73d 100755 (executable)
@@ -52,8 +52,13 @@ my $mode = $input->param('mode');
 my $id   = $input->param('id');
 
 if ( $mode eq 'job_add' ) {
-    my $startdate =
-      join( '', ( split m|/|, $input->param('startdate') )[ 2, 0, 1 ] );
+
+    # Retrieving the date according to the dateformat syspref
+    my $c4date = C4::Dates->new($input->param('startdate'));
+
+    # Formatting it for Schedule::At
+    my $startdate = join('', (split /-/, $c4date->output("iso")));
+
     my $starttime = $input->param('starttime');
     my $recurring = $input->param('recurring');
     $starttime =~ s/\://g;