Bug 30718: Fix scheduler
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 18 Jul 2022 13:27:22 +0000 (15:27 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 19 Aug 2022 11:26:38 +0000 (08:26 -0300)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
tools/scheduler.pl

index 9f797ba..ecee48e 100755 (executable)
@@ -52,8 +52,10 @@ my $id   = $input->param('id');
 
 if ( $mode eq 'job_add' ) {
 
-    my $startdate = dt_from_string( scalar $input->param('startdate') )->ymd;
+    my $startdate = dt_from_string( scalar $input->param('startdate'), 'iso' )->ymd;
 
+    # Formatting it for Schedule::At
+    $startdate = join('', (split /-/, $startdate));
     my $starttime = $input->param('starttime');
     $starttime =~ s/\://g;
     my $start  = $startdate . $starttime;