| |
27 |
27 |
if {![empty_string_p $event_time]} { |
| |
28 |
28 |
array set event_time_arr $event_time |
| |
29 |
29 |
} |
| |
30 |
30 |
|
| |
31 |
31 |
# extract from even-date |
| |
32 |
32 |
set year $event_date_arr(year) |
| |
33 |
33 |
set day $event_date_arr(day) |
| |
34 |
34 |
set month $event_date_arr(month) |
| |
35 |
35 |
|
| |
36 |
36 |
if {![empty_string_p $event_time]} { |
| |
37 |
37 |
# extract from event_time |
| |
38 |
38 |
set hours $event_time_arr(hours) |
| |
39 |
39 |
set minutes $event_time_arr(minutes) |
| |
40 |
40 |
|
| |
41 |
41 |
# AM/PM? (ben - openacs fix) |
| |
42 |
42 |
if {[info exists event_time_arr(ampm)]} { |
| |
43 |
43 |
if {$event_time_arr(ampm)} { |
| |
44 |
44 |
if {$hours < 12} { |
| |
45 |
45 |
incr hours 12 |
| |
46 |
46 |
} |
| |
|
47 |
} else { |
| |
|
48 |
# This is the case where we're dealing with AM/PM |
| |
|
49 |
# The one issue we have to worry about is 12am |
| |
|
50 |
if {!$event_time_arr(ampm) && $hours == 12} { |
| |
|
51 |
set hours 0 |
| |
47 |
52 |
} |
| |
48 |
53 |
} |
| |
|
54 |
} |
| |
49 |
55 |
|
| |
50 |
56 |
if {$hours < 10} { |
| |
51 |
57 |
set hours "0$hours" |
| |
52 |
58 |
} |
| |
53 |
59 |
|
| |
54 |
60 |
} |
| |
55 |
61 |
|
| |
56 |
62 |
|
| |
57 |
63 |
if {$month < 10} { |
| |
58 |
64 |
set month "0$month" |
| |
59 |
65 |
} |
| |
60 |
66 |
|
| |
61 |
67 |
if {$day < 10} { |
| |
62 |
68 |
set day "0$day" |
| |
63 |
69 |
} |
| |
64 |
70 |
|
| |
65 |
71 |
if {[empty_string_p $event_time]} { |
| |
66 |
72 |
return "$year-$month-$day" |
| |
67 |
73 |
} else { |
| |
68 |
74 |
return "$year-$month-$day $hours:$minutes" |