Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #4305 (closed enhancement: untested)

Opened 2 years ago

Last modified 1 year ago

[PATCH] Make date/time tag helpers more flexible

Reported by: japgolly@gmail.com Assigned to: David
Priority: normal Milestone: 1.2.4
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

Sometimes I need a user to select a date and time within a certain range. To make it more easier for the end user I've created a patch for the ActionView tag helpers so that select_month, select_year, select_minute and select_hour will output less <option> tags. An example of this in use is

datetime_select("lesson", "lesson_time", :min_date => Date.today,
    :max_date => 12.weeks.from_now, :start_hour => 8, :end_hour => 20)

These are the changes:
* select_year now accepts :min_date, :max_date
* select_month now accepts :min_date, :max_date, :start_month, :end_month
* select_hour now accepts :min_time, :max_time
* select_minute now accepts :min_time, :max_time, :start_minute, :end_minute

Attachments

patch.diff (6.8 kB) - added by japgolly@gmail.com on 03/19/06 03:23:31.
ticket_4305_r5168.patch (6.9 kB) - added by japgolly on 09/23/06 07:16:33.

Change History

03/19/06 03:23:31 changed by japgolly@gmail.com

  • attachment patch.diff added.

03/19/06 03:24:29 changed by japgolly@gmail.com

  • type changed from defect to enhancement.

09/23/06 07:16:33 changed by japgolly

  • attachment ticket_4305_r5168.patch added.

09/23/06 07:17:00 changed by japgolly

  • version changed from 1.0.0 to edge.

Updated out-of-date patch.

09/23/06 14:27:38 changed by japgolly

  • keywords set to tiny.

06/08/07 00:47:59 changed by josh

  • keywords deleted.
  • status changed from new to closed.
  • resolution set to untested.

Needs unit tests.