event_calendar_engine 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.10
|
@@ -10,8 +10,8 @@ class EventsController < EventCalendar::ApplicationController
|
|
10
10
|
{
|
11
11
|
:id => event.id,
|
12
12
|
:title => event.name,
|
13
|
-
:start => event.start_on,
|
14
|
-
:end => event.end_on,
|
13
|
+
:start => event.start_on.in_time_zone(event.timezone),
|
14
|
+
:end => event.end_on.in_time_zone(event.timezone),
|
15
15
|
:url => event_path(event),
|
16
16
|
:details => render_to_string(:partial => 'events/details', :object => event)
|
17
17
|
}
|
@@ -32,8 +32,8 @@ class EventsController < EventCalendar::ApplicationController
|
|
32
32
|
end_min = params[:event].delete :"end_time(5i)"
|
33
33
|
start_date = Date.parse(params[:event][:start_date])
|
34
34
|
end_date = Date.parse(params[:event][:end_date])
|
35
|
-
params[:event][:start_on] = Time.local(start_date.
|
36
|
-
params[:event][:end_on] = Time.local(end_date.
|
35
|
+
params[:event][:start_on] = Time.local(nil, start_min, start_hour, start_date.day, start_date.month, start_date.year, nil, nil, nil, params[:event][:timezone])
|
36
|
+
params[:event][:end_on] = Time.local(nil, end_min, end_hour, end_date.day, end_date.month, end_date.year, nil, nil, nil, params[:event][:timezone])
|
37
37
|
params[:event][:start_time] = params[:event][:start_on]
|
38
38
|
params[:event][:end_time] = params[:event][:end_on]
|
39
39
|
end
|
@@ -2,46 +2,48 @@ module EventInstanceMethods
|
|
2
2
|
attr_accessor :start_time, :end_time, :start_date, :end_date
|
3
3
|
|
4
4
|
def start_time
|
5
|
-
@start_time ||= start_on
|
5
|
+
@start_time ||= start_on.present? ? start_on.in_time_zone(timezone) : start_on
|
6
6
|
end
|
7
7
|
|
8
8
|
def end_time
|
9
|
-
@end_time ||= end_on
|
9
|
+
@end_time ||= end_on.present? ? end_on.in_time_zone(timezone) : end_on
|
10
10
|
end
|
11
11
|
|
12
12
|
def start_date
|
13
|
-
@start_date ||= start_on.present? ? start_on.to_date : start_on
|
13
|
+
@start_date ||= start_on.present? ? start_on.in_time_zone(timezone).to_date : start_on
|
14
14
|
end
|
15
15
|
|
16
16
|
def end_date
|
17
|
-
@end_date ||= end_on.present? ? end_on.to_date : end_on
|
17
|
+
@end_date ||= end_on.present? ? end_on.in_time_zone(timezone).to_date : end_on
|
18
18
|
end
|
19
19
|
|
20
20
|
def start_year
|
21
|
-
start_on.year
|
21
|
+
start_on.present? ? start_on.in_time_zone(timezone).year : start_on
|
22
22
|
end
|
23
23
|
|
24
24
|
def start_month
|
25
|
-
start_on.strftime("%B")
|
25
|
+
start_on.present? ? start_on.in_time_zone(timezone).strftime("%B") : start_on
|
26
26
|
end
|
27
27
|
|
28
28
|
def start_day
|
29
|
-
start_on.day
|
29
|
+
start_on.present? ? start_on.in_time_zone(timezone).day : start_on
|
30
30
|
end
|
31
31
|
|
32
32
|
def end_year
|
33
|
-
end_on.year
|
33
|
+
end_on.present? ? end_on.in_time_zone(timezone).year : end_on
|
34
34
|
end
|
35
35
|
|
36
36
|
def end_month
|
37
|
-
end_on.strftime("%B")
|
37
|
+
end_on.present? ? end_on.in_time_zone(timezone).strftime("%B") : end_on
|
38
38
|
end
|
39
39
|
|
40
40
|
def end_day
|
41
|
-
end_on.day
|
41
|
+
end_on.present? ? end_on.in_time_zone(timezone).day : end_on
|
42
42
|
end
|
43
43
|
|
44
44
|
def one_day?
|
45
|
-
start_day == end_day
|
45
|
+
start_day == end_day &&
|
46
|
+
start_month == end_month &&
|
47
|
+
start_year == end_year
|
46
48
|
end
|
47
49
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<p><em>mouse over an event to preview; click on an event for full details</em></p>
|
2
2
|
|
3
|
-
<div id="
|
3
|
+
<div id="calendar" class="calendars"></div>
|
4
4
|
|
5
5
|
<div style="clear:both"></div>
|
6
6
|
|
7
|
-
<div id="
|
7
|
+
<div id="event_quick_description" class="span-12" style="display:none"></div>
|
8
8
|
|
9
9
|
<% content_for :javascript do %>
|
10
10
|
<script type="text/javascript">
|
@@ -1,6 +1,10 @@
|
|
1
1
|
<%- if current_event_counter == 0; then current_event_counter += 1; end -%>
|
2
2
|
<div class="span-2<%= current_event_counter % 8 == 0 ? ' last' : '' %>">
|
3
3
|
<p><strong><%= link_to current_event.name, event_path(current_event) %></strong></p>
|
4
|
-
|
5
|
-
|
4
|
+
<%- if current_event.one_day? -%>
|
5
|
+
<%= render :partial => 'events/times', :object => times_with_zones(current_event) %>
|
6
|
+
<%- else -%>
|
7
|
+
<p><em><%= current_event.start_on.in_time_zone(current_event.timezone).strftime("%a, %b %d") %></em></p>
|
8
|
+
<p><em><%= current_event.end_on.in_time_zone(current_event.timezone).strftime("%a, %b %d") %></em></p>
|
9
|
+
<%- end -%>
|
6
10
|
</div>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_calendar_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 10
|
10
|
+
version: 0.1.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jason LaPier
|