<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -166,4 +166,17 @@ module ApplicationHelper
     return rt+rp+rts
   end
 
+  def date_format_for_date_picker()
+    standard_format = current_user.prefs.date_format
+    translations = [
+      ['%m', 'mm'],
+      ['%d', 'dd'],
+      ['%Y', 'yy'],
+      ['%y', 'y']
+    ]
+    translations.inject(standard_format) do |str, translation|
+      str.gsub(*translation)
+    end
+  end
+
 end</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,6 +32,7 @@
       var defaultContexts = &lt;%= default_contexts_for_autocomplete %&gt;;
       var defaultTags = &lt;%= default_tags_for_autocomplete %&gt;;
       var tagNames = &lt;%= tag_names_for_autocomplete %&gt;;
+      var dateFormat = '&lt;%= date_format_for_date_picker %&gt;';
       &lt;% end -%&gt;
     &lt;/script&gt;
     &lt;link rel=&quot;shortcut icon&quot; href=&quot;&lt;%= url_for(:controller =&gt; 'favicon.ico') %&gt;&quot; /&gt;</diff>
      <filename>app/views/layouts/standard.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -185,7 +185,7 @@ function project_defaults(){
 }
 
 function enable_rich_interaction(){
-  $('input.Date').datepicker();
+  $('input.Date').datepicker({'dateFormat': dateFormat});
   /* Autocomplete */
   $('input[name=context_name]').autocomplete(contextNames);
   $('input[name=project[default_context_name]]').autocomplete(contextNames);</diff>
      <filename>public/javascripts/application.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c1dfeaf0f234ea80be13507c1ca4682e99e249b0</id>
    </parent>
  </parents>
  <author>
    <name>Eric Allen</name>
    <email>ericpallen@gmail.com</email>
  </author>
  <url>http://github.com/bsag/tracks/commit/686086dcdffb56f97633e4d65e9ab01d1d10b72d</url>
  <id>686086dcdffb56f97633e4d65e9ab01d1d10b72d</id>
  <committed-date>2009-10-30T12:37:40-07:00</committed-date>
  <authored-date>2009-10-30T12:37:40-07:00</authored-date>
  <message>Initial attempt to resolve dateFormat issue

Translating from strftime format to jQuery UI's format on the fly on every
page render. That kind of sucks, but it works. I think I have enough
translations here to cover everybody, but possibly not.</message>
  <tree>fe7192a83d473e498f230846d1a7c303cb42f268</tree>
  <committer>
    <name>Eric Allen</name>
    <email>ericpallen@gmail.com</email>
  </committer>
</commit>
