Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[#28013453] alterando data de schedule de date para datetime; teste d…

…e forum esta quebrado mas nao mexi pois forum esta sendo refeito...
  • Loading branch information...
commit 6bbba9e48fde0f9af7c3d6400dba18acd4fab9d4 1 parent 689f4f1
@patriciapaula patriciapaula authored
View
6 app/helpers/discussion_posts_helper.rb
@@ -16,12 +16,12 @@ def valid_date_bf
def valid_date
discussion_schedule = Schedule.find(@discussion.schedule_id)
- today_between_discussion_start_end = (discussion_schedule.start_date <= Date.today && Date.today <= discussion_schedule.end_date)
+ today_between_discussion_start_end = (discussion_schedule.start_date.to_date <= Date.today && Date.today <= discussion_schedule.end_date.to_date)
is_an_valid_date = today_between_discussion_start_end
unless today_between_discussion_start_end
- today_is_in_extra_time_period = ( (Date.today - discussion_schedule.end_date) <= Discussion_Responsible_Extra_Time)
+ today_is_in_extra_time_period = ( (Date.today - discussion_schedule.end_date.to_date) <= Discussion_Responsible_Extra_Time)
is_an_valid_date = (is_current_user_class_responsible? and today_is_in_extra_time_period)
end
@@ -30,7 +30,7 @@ def valid_date
def extra_period(discussion)
discussion_schedule = Schedule.find(discussion.schedule_id)
- today_is_in_extra_time_period = ((Date.today - discussion_schedule.end_date) <= Discussion_Responsible_Extra_Time && (Date.today - discussion_schedule.end_date) > 0)
+ today_is_in_extra_time_period = ((Date.today - discussion_schedule.end_date.to_date) <= Discussion_Responsible_Extra_Time && (Date.today - discussion_schedule.end_date.to_date) > 0)
current_user_class_responsible = AllocationTag.find(discussion.allocation_tag_id).is_user_class_responsible?(current_user.id)
return (current_user_class_responsible and today_is_in_extra_time_period)
end
View
4 app/views/curriculum_units/_lesson_portlet.html.erb
@@ -9,11 +9,11 @@
<% schedule= Schedule.find(lesson.schedule_id) %>
<% if lesson.schedule.end_date.nil? %>
<span class="block_content_gray">
- <%= l schedule.start_date %>
+ <%= l schedule.start_date, :format => :normal %>
</span>
<% elsif lesson.schedule.end_date >= Date.today or lesson.schedule.end_date < Date.today %>
<span class="block_content_gray">
- <%= l schedule.start_date %> - <%= l schedule.end_date %>
+ <%= l schedule.start_date, :format => :normal %> - <%= l schedule.end_date, :format => :normal %>
</span>
<% end %>
<% unless lesson.schedule.end_date < Date.today %>
View
6 app/views/lessons/list.html.erb
@@ -26,11 +26,11 @@
</td>
<td>
<% if lesson.schedule.end_date.nil? %>
- <%= l lesson.schedule.start_date %>
+ <%= l lesson.schedule.start_date, :format => :normal %>
<% elsif lesson.schedule.end_date >= Date.today %>
- <%= l lesson.schedule.start_date %> - <%= l lesson.schedule.end_date %>
+ <%= l lesson.schedule.start_date, :format => :normal %> - <%= l lesson.schedule.end_date, :format => :normal %>
<% elsif lesson.schedule.end_date < Date.today %>
- <%= l lesson.schedule.start_date %> - <%= l lesson.schedule.end_date %>
+ <%= l lesson.schedule.start_date, :format => :normal %> - <%= l lesson.schedule.end_date, :format => :normal %>
<%end%>
</td>
</tr>
View
11 db/migrate/20120507133402_alter_schedule_date.rb
@@ -0,0 +1,11 @@
+class AlterScheduleDate < ActiveRecord::Migration
+ def self.up
+ change_column :schedules, :start_date, :datetime
+ change_column :schedules, :end_date, :datetime
+ end
+
+ def self.down
+ change_column :schedules, :start_date, :date
+ change_column :schedules, :end_date, :date
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.