Skip to content

Commit d361466

Browse files
committed
fix setting start date for guest fruit show
1 parent 8e312dc commit d361466

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

app/controllers/api/my_shows_controller.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ def create
2424
end_time = DateTime.parse my_show_params[:end_time]
2525
start_date = DateTime.parse my_show_params[:start_date]
2626
time_zone = current_user.time_zone
27-
episode.start_at = DateTime.new start_date.year,
28-
start_date.month,
29-
start_date.day,
30-
start_time.hour,
31-
0,
32-
0,
33-
current_user.time_zone
27+
start = Time.use_zone(time_zone) do
28+
Time.zone.local start_date.year,
29+
start_date.month,
30+
start_date.day,
31+
start_time.in_time_zone(time_zone).hour,
32+
0,
33+
0
34+
end
35+
episode.start_at = start.to_datetime
3436
episode.end_at = episode.start_at + ((end_time - start_time) * 24).to_i.hours
3537
episode.playlist = guest_series.radio.default_playlist
3638
episode.dj_id = users_params[:user_ids].first

0 commit comments

Comments
 (0)