Lines 130-160
sub output_pref {
Link Here
|
130 |
my $time_format = $force_time || C4::Context->preference('TimeFormat'); |
130 |
my $time_format = $force_time || C4::Context->preference('TimeFormat'); |
131 |
my $time = ( $time_format eq '12hr' ) ? '%I:%M %p' : '%H:%M'; |
131 |
my $time = ( $time_format eq '12hr' ) ? '%I:%M %p' : '%H:%M'; |
132 |
|
132 |
|
133 |
given ($pref) { |
133 |
if ( $pref =~ m/^iso/ ) { |
134 |
when (/^iso/) { |
134 |
return $dateonly |
135 |
return $dateonly |
135 |
? $dt->strftime("%Y-%m-%d") |
136 |
? $dt->strftime("%Y-%m-%d") |
136 |
: $dt->strftime("%Y-%m-%d $time"); |
137 |
: $dt->strftime("%Y-%m-%d $time"); |
137 |
} |
138 |
} |
138 |
elsif ( $pref =~ m/^metric/ ) { |
139 |
when (/^metric/) { |
139 |
return $dateonly |
140 |
return $dateonly |
140 |
? $dt->strftime("%d/%m/%Y") |
141 |
? $dt->strftime("%d/%m/%Y") |
141 |
: $dt->strftime("%d/%m/%Y $time"); |
142 |
: $dt->strftime("%d/%m/%Y $time"); |
142 |
} |
143 |
} |
143 |
elsif ( $pref =~ m/^us/ ) { |
144 |
when (/^us/) { |
|
|
145 |
|
146 |
return $dateonly |
147 |
? $dt->strftime("%m/%d/%Y") |
148 |
: $dt->strftime("%m/%d/%Y $time"); |
149 |
} |
150 |
default { |
151 |
return $dateonly |
152 |
? $dt->strftime("%Y-%m-%d") |
153 |
: $dt->strftime("%Y-%m-%d $time"); |
154 |
} |
155 |
|
144 |
|
|
|
145 |
return $dateonly |
146 |
? $dt->strftime("%m/%d/%Y") |
147 |
: $dt->strftime("%m/%d/%Y $time"); |
156 |
} |
148 |
} |
157 |
return; |
149 |
else { |
|
|
150 |
return $dateonly |
151 |
? $dt->strftime("%Y-%m-%d") |
152 |
: $dt->strftime("%Y-%m-%d $time"); |
153 |
} |
154 |
|
158 |
} |
155 |
} |
159 |
|
156 |
|
160 |
=head2 output_pref_due |
157 |
=head2 output_pref_due |
161 |
- |
|
|