Added in ability for the calendar popup to work for the preferenced date format

This commit is contained in:
bob_lyon 2006-11-27 00:27:43 +00:00
parent 30747d81bd
commit 8d9e05d07c
2 changed files with 17 additions and 7 deletions

View File

@ -277,9 +277,19 @@ if(C4::Context->preference("RoutingSerials")){
}
push( @sub_type_data, \%row );
}
$template->param(subtype => \@sub_type_data,
weekarrayjs => $weekarrayjs,
weekno => $weekno,
my $dateformat;
my $dateformatcode = C4::Context->preference('dateformat');
if($dateformatcode eq 'US' || $dateformatcode eq 'us'){
$dateformat = '%m/%d/%Y';
} elsif ($dateformatcode eq 'ISO' || $dateformatcode eq 'iso'){
$dateformat = '%Y/%m/%d';
} else {
$dateformat = '%d/%m/%Y';
}
$template->param(subtype => \@sub_type_data,
weekarrayjs => $weekarrayjs,
weekno => $weekno,
dateformat => $dateformat,
);
output_html_with_http_headers $query, $cookie, $template->output;
}

View File

@ -743,7 +743,7 @@ function check_input(e){
<script type="text/javascript">
Calendar.setup({
inputField:"acqui_date",
ifFormat : "%d/%m/%Y",
ifFormat : "<!-- TMPL_VAR NAME="dateformat" -->",
button : "button2",
align : "Tl"
});
@ -751,7 +751,7 @@ function check_input(e){
<script type="text/javascript">
Calendar.setup({
inputField : "acqui_date",
ifFormat : "%d/%m/%Y",
ifFormat : "<!-- TMPL_VAR NAME="dateformat" -->",
button : "acqui_date",
align : "Tl"
});
@ -875,7 +875,7 @@ function check_input(e){
<script type="text/javascript">
Calendar.setup({
inputField : "beginning_date",
ifFormat : "%d/%m/%Y",
ifFormat : "<!-- TMPL_VAR NAME="dateformat" -->",
button : "button1",
align : "Tl"
});
@ -883,7 +883,7 @@ function check_input(e){
<script type="text/javascript">
Calendar.setup({
inputField : "beginning_date",
ifFormat : "%d/%m/%Y",
ifFormat : "<!-- TMPL_VAR NAME="dateformat" -->",
button : "beginning_date",
align : "Tl"
});