Skip to content

Commit

Permalink
Merge pull request #34 from offthread/development
Browse files Browse the repository at this point in the history
Fixing datetime for events
  • Loading branch information
filipecosta01 committed Jun 12, 2016
2 parents dd74d63 + 71ead54 commit 4885c68
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 107 deletions.
6 changes: 2 additions & 4 deletions app/controllers/telegram_webhooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,11 @@ def getShowsFormatted(shows, dateFormatted)
responseMessage = t(:shows_title_message, :dateFormatted => dateFormatted, :weekDay => weekDayStr)
shows.each do |show|
responseMessage += t(:event_title, :eventTitle => show.name)

responseMessage += t(:event_time, :eventTime => show.hour)

eventConfirmed = show.is_confirmed ? t(:confirmed) : t(:not_confirmed)
responseMessage += t(:event_confirmed, :eventConfirmed => eventConfirmed)
responseMessage += t(:event_band_info, :moreInfo => show.link_band)

showTime = show.date.strftime("%H:%M")
responseMessage += t(:event_time, :eventTime => showTime)
end
responseMessage += END_STREAM_STRING

Expand Down
4 changes: 2 additions & 2 deletions config/locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pt-BR:

event_title : "-> %{eventTitle}\n"
event_confirmed : "- Evento confirmado: %{eventConfirmed}\n"
event_band_info : "- Informações da banda: %{moreInfo}\n"
event_time : "- Início estimado: %{eventTime}\n\n"
event_band_info : "- Informações da banda: %{moreInfo}\n\n"
event_time : "- Início estimado: %{eventTime}\n"

confirmed : "Sim"
not_confirmed : "Não"
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20160515171902_create_shows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def change
t.datetime :date
t.boolean :is_confirmed
t.string :link_band

t.string :hour
t.timestamps null: false
end
end
Expand Down
1 change: 1 addition & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
t.datetime "date"
t.boolean "is_confirmed"
t.string "link_band"
t.string "hour"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
Expand Down
Loading

0 comments on commit 4885c68

Please sign in to comment.