From 0755309684f65d322840bd625c0f8f6ee9758854 Mon Sep 17 00:00:00 2001 From: bsag Date: Sat, 5 Mar 2005 19:57:41 +0000 Subject: [PATCH] Abstracted the :start_year option in the date_select call in the forms, so that it starts at this year without having to hard code it. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@37 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/views/context/show.rhtml | 3 ++- tracks/app/views/project/show.rhtml | 3 ++- tracks/app/views/todo/_item.rhtml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tracks/app/views/context/show.rhtml b/tracks/app/views/context/show.rhtml index 5624668b..081d0691 100644 --- a/tracks/app/views/context/show.rhtml +++ b/tracks/app/views/context/show.rhtml @@ -23,7 +23,8 @@ <%= options_from_collection_for_select(@projects, "id", "name" ) %>

- <%= date_select( "new_item", "due", :include_blank => true, :start_year => 2005 ) %> + <% now = Date.today %> +<%= date_select( "new_item", "due", :include_blank => true, :start_year => now.year, "tabindex" => 5 ) %>
diff --git a/tracks/app/views/project/show.rhtml b/tracks/app/views/project/show.rhtml index 2618aa58..cfca3a50 100644 --- a/tracks/app/views/project/show.rhtml +++ b/tracks/app/views/project/show.rhtml @@ -30,7 +30,8 @@

- <%= date_select( "new_item", "due", :include_blank => true, :start_year => 2005 ) %> + <% now = Date.today %> + <%= date_select( "new_item", "due", :include_blank => true, :start_year => now.year, "tabindex" => 5 ) %>
diff --git a/tracks/app/views/todo/_item.rhtml b/tracks/app/views/todo/_item.rhtml index bd833e56..466ab782 100644 --- a/tracks/app/views/todo/_item.rhtml +++ b/tracks/app/views/todo/_item.rhtml @@ -36,6 +36,7 @@

-<%= date_select( "item", "due", :include_blank => true, :start_year => 2005, "tabindex" => 5 ) %> +<% now = Date.today %> +<%= date_select( "item", "due", :include_blank => true, :start_year => now.year, "tabindex" => 5 ) %>