contractnumber => $contract->{contractnumber},
contractname => $contract->{contractname},
contractdescription => $contract->{contractdescription},
- contractstartdate => output_pref({ dt => dt_from_string( $contract->{contractstartdate} ), dateonly => 1 }),
- contractenddate => output_pref({ dt => dt_from_string( $contract->{contractenddate} ), dateonly => 1 }),
+ contractstartdate => $contract->{contractstartdate},
+ contractenddate => $contract->{contractenddate},
);
} else {
$template->param(
my $is_a_modif = $input->param("is_a_modif");
+ my $contractstart_dt = eval { dt_from_string( $input->param('contractstartdate') ); };
+ $contractstart_dt = dt_from_string if ( ! $contractstart_dt );
+
+ my $contractend_dt = eval { dt_from_string( $input->param('contractenddate') ); };
+ $contractend_dt = dt_from_string if ( ! $contractend_dt );
+
if ( $is_a_modif ) {
ModContract({
- contractstartdate => output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 }),
- contractenddate => output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 }),
+ contractstartdate => eval { output_pref({ dt => dt_from_string( $contractstart_dt ), dateformat => 'iso', dateonly => 1 } ); },
+ contractenddate => eval { output_pref({ dt => dt_from_string( $contractend_dt ), dateformat => 'iso', dateonly => 1 } ); },
contractname => $input->param('contractname'),
contractdescription => $input->param('contractdescription'),
booksellerid => $input->param('booksellerid'),
contractname => $input->param('contractname'),
contractdescription => $input->param('contractdescription'),
booksellerid => $input->param('booksellerid'),
- contractstartdate => output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 }),
- contractenddate => output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 }),
+ contractstartdate => eval { output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 } ); },
+ contractenddate => eval { output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 } ); },
});
}
contractnumber => $$contract{contractnumber},
contractname => $$contract{contractname},
contractdescription => $$contract{contractdescription},
- contractstartdate => output_pref({ dt => dt_from_string( $$contract{contractstartdate} ), dateonly => 1 }),
- contractenddate => output_pref({ dt => dt_from_string( $$contract{contractenddate} ), dateonly => 1 }),
+ contractstartdate => $$contract{contractstartdate},
+ contractenddate => $$contract{contractenddate},
);
# END $OP eq DELETE_CONFIRM
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Acquisitions › Contracts ›
[% IF ( add_form ) %]
<input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription %]" />
</li>
<li><label for="from" class="required">Start date: *</label>
- <input type="text" name="contractstartdate" id="from" value="[% contractstartdate %]" maxlength="10" size="10" class="datepickerfrom" />
+ <input type="text" name="contractstartdate" id="from" value="[% contractstartdate | $KohaDates %]" maxlength="10" size="10" class="datepickerfrom" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li><label for="to" class="required">End date: *</label>
- <input type="text" name="contractenddate" id="to" value="[% contractenddate %]" maxlength="10" size="10" class="datepickerto" />
+ <input type="text" name="contractenddate" id="to" value="[% contractenddate | $KohaDates %]" maxlength="10" size="10" class="datepickerto" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
</ol>
<tr><th scope="row">Contract number:</th><td>[% contractnumber %]</td></tr>
<tr><th scope="row">Contract name:</th><td>[% contractname %]</td></tr>
<tr><th scope="row">Contract description:</th><td>[% contractdescription %]</td></tr>
- <tr><th scope="row">Contract start date:</th><td>[% contractstartdate %]</td></tr>
- <tr><th scope="row">Contract end date:</th><td>[% contractenddate %]</td></tr>
+ <tr><th scope="row">Contract start date:</th><td>[% contractstartdate | $KohaDates %]</td></tr>
+ <tr><th scope="row">Contract end date:</th><td>[% contractenddate | $KohaDates %]</td></tr>
<tr><th scope="row">Vendor:</th><td>[% booksellername %]</td></tr>
</table>
<fieldset class="action">