diff --git a/tracks/app/views/layouts/standard.rhtml b/tracks/app/views/layouts/standard.rhtml
index 9f049dca..7498b664 100644
--- a/tracks/app/views/layouts/standard.rhtml
+++ b/tracks/app/views/layouts/standard.rhtml
@@ -27,7 +27,7 @@
<% if @count %>
<%= @count %>
<% end %>
- <%= user_time.strftime("%A, %d %B %Y") %> <%= image_tag("spinner.gif", :size => "16X16", :border => 0, :id => 'busy', :style => 'display:none' ) %>
+ <%= user_time.strftime(@prefs.title_date_format) %> <%= image_tag("spinner.gif", :size => "16X16", :border => 0, :id => 'busy', :style => 'display:none' ) %>
diff --git a/tracks/app/views/preferences/edit.rhtml b/tracks/app/views/preferences/edit.rhtml
index d307ec14..8666a07c 100644
--- a/tracks/app/views/preferences/edit.rhtml
+++ b/tracks/app/views/preferences/edit.rhtml
@@ -4,6 +4,7 @@
- first name and last name: Used for display purposes if set
- date format: the format in which you'd like dates to be shown. For example, for the date 31st January 2006, %d/%m/%Y will show 31/01/2006, %b-%e-%y will show Jan-31-06. See the strftime manual for more formatting options for the date.
+ - title date format: same as above, but for the big date at the top of each page.
- time zone: your local time zone
- week starts: day of the week shown as the start of the week on the popup calendar.
- due style: style in which due dates are shown, e.g. "Due in 3 days", "Due on Wednesday"
@@ -49,6 +50,7 @@
end
%>
<%= row_with_text_field('date_format') %>
+ <%= row_with_text_field('title_date_format') %>
<%= table_row('time_zone', false) { time_zone_select('prefs','time_zone') } %>
<%= row_with_select_field("week_starts", Preference.day_number_to_name_map.invert.sort{|a,b| a[1]<=>b[1]})%>
diff --git a/tracks/app/views/preferences/index.rhtml b/tracks/app/views/preferences/index.rhtml
index 78b90a16..76b415dd 100644
--- a/tracks/app/views/preferences/index.rhtml
+++ b/tracks/app/views/preferences/index.rhtml
@@ -5,7 +5,8 @@
- First name: <%= @user.first_name %>
- Last name: <%= @user.last_name %>
- - Date format: <%= @prefs.date_format %> Your current date: <%= format_date Time.now.utc %>
+ - Date format: <%= @prefs.date_format %> Your current date: <%= format_date(user_time) %>
+ - Title date format: <%= @prefs.title_date_format %> Your current title date: <%= user_time.strftime(@prefs.title_date_format) %>
- Time zone: <%= @prefs.tz %> Your current time: <%= user_time.strftime('%I:%M %p') %>
- Week starts on: <%= Preference.day_number_to_name_map[@prefs.week_starts] %>
- Show the last <%= @prefs.show_number_completed %> completed items on the home page
diff --git a/tracks/db/migrate/029_add_title_date_format_preference.rb b/tracks/db/migrate/029_add_title_date_format_preference.rb
new file mode 100644
index 00000000..ac86fde6
--- /dev/null
+++ b/tracks/db/migrate/029_add_title_date_format_preference.rb
@@ -0,0 +1,9 @@
+class AddTitleDateFormatPreference < ActiveRecord::Migration
+ def self.up
+ add_column :preferences, :title_date_format, :string, :limit => 255, :default => '%A, %d %B %Y', :null => false
+ end
+
+ def self.down
+ remove_column :preferences, :title_date_format
+ end
+end
diff --git a/tracks/db/schema.rb b/tracks/db/schema.rb
index ebc8cae2..e2b6f1b5 100644
--- a/tracks/db/schema.rb
+++ b/tracks/db/schema.rb
@@ -2,7 +2,7 @@
# migrations feature of ActiveRecord to incrementally modify your database, and
# then regenerate this schema definition.
-ActiveRecord::Schema.define(:version => 28) do
+ActiveRecord::Schema.define(:version => 29) do
create_table "contexts", :force => true do |t|
t.column "name", :string, :default => "", :null => false
@@ -58,6 +58,7 @@ ActiveRecord::Schema.define(:version => 28) do
t.column "show_hidden_projects_in_sidebar", :boolean, :default => true, :null => false
t.column "time_zone", :string, :default => "London", :null => false
t.column "show_project_on_todo_done", :boolean, :default => false, :null => false
+ t.column "title_date_format", :string, :default => "%A, %d %B %Y", :null => false
end
add_index "preferences", ["user_id"], :name => "index_preferences_on_user_id"
diff --git a/tracks/test/fixtures/preferences.yml b/tracks/test/fixtures/preferences.yml
index 59f56760..380d1dc7 100644
--- a/tracks/test/fixtures/preferences.yml
+++ b/tracks/test/fixtures/preferences.yml
@@ -4,6 +4,7 @@ admin_user_prefs:
user_id: 1
staleness_starts: 7
date_format: "%d/%m/%Y"
+ title_date_format: "%A, %d %B %Y"
show_number_completed: 5
show_completed_projects_in_sidebar: true
show_hidden_contexts_in_sidebar: true
@@ -21,6 +22,7 @@ other_user_prefs:
user_id: 2
staleness_starts: 7
date_format: "%d/%m/%Y"
+ title_date_format: "%A, %d %B %Y"
show_number_completed: 5
show_completed_projects_in_sidebar: true
show_hidden_contexts_in_sidebar: true