Skip to content

Commit

Permalink
commiting for change of time
Browse files Browse the repository at this point in the history
  • Loading branch information
LED committed May 4, 2012
1 parent a58a1e9 commit 65ae4ef
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/admin/reservations.rb
Expand Up @@ -76,11 +76,11 @@
column :date do |d|
d.date.strftime("%B %d,%Y")
end
column :time_start do |ts|
ts.time_start.strftime('%l:%M - %P')
column :event_start do |ts|
ts.event_start.strftime('%l:%M - %P')
end
column :time_end do |time|
time.time_end.strftime('%l:%M - %P')
column :event_end do |time|
time.event_end.strftime('%l:%M - %P')
end
column :numGuest
column :service do |s|
Expand Down
6 changes: 3 additions & 3 deletions app/views/reservations/show.html.erb
Expand Up @@ -26,12 +26,12 @@


<tr>
<td colspan="2"><strong>Time Start: </strong> <%= @reservation.time_start.strftime('%l:%M - %P')%></td>
<td colspan="2"><strong>Time Start: </strong> <%= @reservation.event_start.strftime('%l:%M - %P')%></td>
<td>&nbsp;</td>
<td colspan="3"><strong>Time End: </strong><%= @reservation.time_end.strftime('%l:%M - %P')%></td>
<td colspan="3"><strong>Time End: </strong><%= @reservation.event_end.strftime('%l:%M - %P')%></td>
</tr>
<tr>
<td><strong>Total Hours you will render: </strong><%timex=Time.diff(Time.parse(@reservation.time_start.to_s), Time.parse(@reservation.time_end.to_s), '%H %N')%>
<td><strong>Total Hours you will render: </strong><%timex=Time.diff(Time.parse(@reservation.event_start.to_s), Time.parse(@reservation.event_end.to_s), '%H %N')%>
<%= timex[:diff]%></td>
</tr>

Expand Down
6 changes: 6 additions & 0 deletions db/migrate/20120504065238_add_event_start_to_reservation.rb
@@ -0,0 +1,6 @@
class AddEventStartToReservation < ActiveRecord::Migration
def change
add_column :reservations, :event_start, :time

end
end
6 changes: 6 additions & 0 deletions db/migrate/20120504065310_add_event_end_to_reservation.rb
@@ -0,0 +1,6 @@
class AddEventEndToReservation < ActiveRecord::Migration
def change
add_column :reservations, :event_end, :time

end
end
4 changes: 3 additions & 1 deletion db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120504061656) do
ActiveRecord::Schema.define(:version => 20120504065310) do

create_table "active_admin_comments", :force => true do |t|
t.string "resource_id", :null => false
Expand Down Expand Up @@ -312,6 +312,8 @@
t.decimal "total_price", :precision => 10, :scale => 0, :default => 0
t.date "booked_at"
t.boolean "reservation_option"
t.time "event_start"
t.time "event_end"
end

create_table "services", :force => true do |t|
Expand Down

0 comments on commit 65ae4ef

Please sign in to comment.