zfoster / corgi

Social Event Calendar System
meetmadi.com
Other
3 stars 2 forks source link

Date, Time, Datetime, and creating events #165

Open mbrakken opened 10 years ago

mbrakken commented 10 years ago

Events have start_time and end_time stored as datetime. Currently the event forms have

.form-group
  = f.label :start_time, "Start Date"
  = f.date_field :start_time, class: 'form-control'
.form-group
  = f.label :start_time
  = f.time_select :start_time, class: 'form-control', ampm: true, minute_step: 15
.form-group
  = f.label :end_time, "End Date"
  = f.date_field :end_time, class: 'form-control'
.form-group
  = f.label :end_time
  = f.time_select :end_time, class: 'form-control', ampm: true, minute_step: 15

Basically, we have 2 fields each for start_time and end_time. Because the second in each set only brings in time, it defaults the date to the current date. This means start_date and end_date will always be saved as the current day.

We'll need to parse these in the create/update methods.

mbrakken commented 10 years ago

I have some hacky code in the styles branch to address this, but could probably be done better. Also, I think things will fail in the event that someone is using a non-compatible browser.