Bug 29717: Remove unecessary DT manipulations from tools/additional-contents.pl
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 16 Dec 2021 15:44:30 +0000 (16:44 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 14 Jan 2022 08:12:53 +0000 (22:12 -1000)
DBIC handles DateTime correctly, no need for this output_pref call.

Test plan:
Create a new content, set the dates, confirm they are set correctly
Modify the content, modify the dates, confirm they are stored correctly

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
tools/additional-contents.pl

index d5d02f0..ac384a8 100755 (executable)
@@ -87,21 +87,9 @@ elsif ( $op eq 'add_validate' ) {
 
     my $expirationdate;
     if ( $cgi->param('expirationdate') ) {
-        $expirationdate = output_pref(
-            {
-                dt => dt_from_string( scalar $cgi->param('expirationdate') ),
-                dateformat => 'iso',
-                dateonly   => 1
-            }
-        );
+        $expirationdate = dt_from_string( scalar $cgi->param('expirationdate') );
     }
-    my $published_on = output_pref(
-        {
-            dt         => dt_from_string( scalar $cgi->param('published_on') ),
-            dateformat => 'iso',
-            dateonly   => 1
-        }
-    );
+    my $published_on = dt_from_string( scalar $cgi->param('published_on') );
     my $number = $cgi->param('number');
 
     my $success = 1;