From 58f11d6e1536b99594110130664fab636bc58504 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Mon, 18 Jul 2022 15:27:22 +0200
Subject: [PATCH] Bug 30718: Fix scheduler

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
---
 tools/scheduler.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/scheduler.pl b/tools/scheduler.pl
index 9f797ba34a..ecee48e930 100755
--- a/tools/scheduler.pl
+++ b/tools/scheduler.pl
@@ -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;
-- 
2.37.1