1 |
3 |
ahitrov@rambler.ru |
<& '/contenido/components/select.msn', name => $name.'_day', values => \@days, check => $day &> |
2 |
|
|
<& '/contenido/components/select.msn', name => $name.'_month', values => \@months, check => $month &> |
3 |
|
|
<& '/contenido/components/select.msn', name => $name.'_year', values => \@years, check => $year &> |
4 |
|
|
|
5 |
|
|
<& '/contenido/components/select.msn', name => $name.'_hour', values => \@hours, check => $hour &> |
6 |
|
|
<& '/contenido/components/select.msn', name => $name.'_minute', values => \@minutes, check => $minute &> |
7 |
|
|
<& '/contenido/components/select.msn', name => $name.'_second', values => \@seconds, check => $second &> |
8 |
|
|
|
9 |
|
|
<%args> |
10 |
|
|
$prop |
11 |
|
|
$name => undef |
12 |
|
|
$check => undef |
13 |
|
|
</%args> |
14 |
|
|
|
15 |
|
|
<%init> |
16 |
|
|
|
17 |
|
|
my @localtime = localtime(); $localtime[4]++; $localtime[5] += 1900; |
18 |
|
|
|
19 |
|
|
# ��������� ������ ��� select'�... |
20 |
|
|
my @days = map { $_ => $_ } (1..31); |
21 |
|
|
my @months = @{ $m->comp('/contenido/components/get_months.msn') }; |
22 |
|
|
my @years = map { $_ => $_ } ( $localtime[5] - 5 .. $localtime[5] + 5); |
23 |
|
|
my @hours = map { $_ => sprintf('%02d', $_) } (0 .. 23); |
24 |
|
|
my @minutes = map { $_ => sprintf('%02d', $_) } (0 ..59); |
25 |
|
|
my @seconds = map { $_ => sprintf('%02d', $_) } (0 ..59); |
26 |
|
|
|
27 |
|
|
if ($prop->{allow_null}) { |
28 |
|
|
unshift @days, '', ''; |
29 |
|
|
unshift @months, '', ''; |
30 |
|
|
unshift @years, '', ''; |
31 |
|
|
unshift @hours, '', ''; |
32 |
|
|
unshift @minutes, '', ''; |
33 |
|
|
unshift @seconds, '', ''; |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
my ($year,$month,$day,$hour,$minute, $second); |
37 |
|
|
if ($check) { |
38 |
|
|
$check =~ /(\d{4})-(\d{1,2})-(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})/; |
39 |
|
|
($year, $month, $day, $hour, $minute, $second) = ($1 + 0, $2 + 0, $3 + 0, $4 + 0, $5 + 0, $6 + 0); |
40 |
|
|
} elsif(!$prop->{allow_null}) { |
41 |
|
|
($second,$minute,$hour,$day,$month,$year) = @localtime[0 .. 5]; |
42 |
|
|
} |
43 |
|
|
</%init> |