<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -229,4 +229,24 @@ describe(&quot;Ranges&quot;, {
     value_of(Instance.range.get('start')).should_be(DateMiddle);
     value_of(Instance.range.get('end')).should_be(DateLatest);
   }
-});
\ No newline at end of file
+});
+
+describe(&quot;Formatting&quot;, {
+  'before all': function(){
+    setupHTML();
+    Instance = new Timeframe('calendar', { format:&quot;%m/%d/%Y&quot; });
+    FirstDate = new Date(2008, 10, 5, 12);
+    LastDate = new Date(2008, 10, 8, 12);
+  },
+  'after all': function(){
+    teardownHTML();
+  },
+  
+  'should show the format in the start and end dates': function(){
+    Instance.range.empty()
+    Instance.markEndPoint(FirstDate);
+    Instance.markEndPoint(LastDate);
+    value_of(Instance.fields.start.value).should_be(&quot;11/05/2008&quot;);
+    value_of(Instance.fields.end.value).should_be(&quot;11/08/2008&quot;);
+  }
+})
\ No newline at end of file</diff>
      <filename>spec/specs.js</filename>
    </modified>
    <modified>
      <diff>@@ -452,25 +452,23 @@ $extend(Date.prototype, {
     var day = this.getDay(), month = this.getMonth();
     var hours = this.getHours(), minutes = this.getMinutes();
     function pad(num) { return num.toString().pad(2, '0');};
-    return format.replace(/\%([aAbBcdHImMpSwyY])/g, function(part) {
-      switch(part[1]) {
-        case 'a': return Locale.get('dayNames')[day].substr(0, 3); break;
-        case 'A': return Locale.get('dayNames')[day]; break;
-        case 'b': return Locale.get('monthNames')[month].substr(0, 3); break;
-        case 'B': return Locale.get('monthNames')[month].escapeHTML(); break;
-        case 'c': return this.toString(); break;
-        case 'd': return pad(this.getDate()); break;
-        case 'H': return pad(hours); break;
-        case 'I': return (hours % 12 == 0) ? 12 : pad(hours % 12); break;
-        case 'm': return pad(month + 1); break;
-        case 'M': return pad(minutes); break;
-        case 'p': return hours &gt;= 12 ? 'PM' : 'AM'; break;
-        case 'S': return pad(this.getSeconds()); break;
-        case 'w': return day; break;
-        case 'y': return pad(this.getFullYear() % 100); break;
-        case 'Y': return this.getFullYear().toString(); break;
-      }
-    }.bind(this));
+    return format.replace(/\%([aAbBcdHImMpSwyY])/g, &quot;{$1}&quot;).substitute({
+      'a': Locale.get('dayNames')[day].substr(0, 3),
+      'A': Locale.get('dayNames')[day],
+      'b': Locale.get('monthNames')[month].substr(0, 3),
+      'B': Locale.get('monthNames')[month],
+      'c': this.toString(),
+      'd': pad(this.getDate()),
+      'H': pad(hours),
+      'I': (hours % 12 == 0) ? 12 : pad(hours % 12),
+      'm': pad(month + 1),
+      'M': pad(minutes),
+      'p': hours &gt;= 12 ? 'PM' : 'AM',
+      'S': pad(this.getSeconds()),
+      'w': day,
+      'y': pad(this.getFullYear() % 100),
+      'Y': this.getFullYear().toString()
+    });
   },
   
   neutral: function() {</diff>
      <filename>src/timeframe.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>95a69033dd7cf51e05357ea33b66d0e905f663e4</id>
    </parent>
  </parents>
  <author>
    <name>Kyle Neath</name>
    <email>kneath@gmail.com</email>
  </author>
  <url>http://github.com/kneath/timeframe-mootools/commit/8f4968367e6ea456c8c74d0433b273e13570b785</url>
  <id>8f4968367e6ea456c8c74d0433b273e13570b785</id>
  <committed-date>2008-11-03T18:29:31-08:00</committed-date>
  <authored-date>2008-11-03T18:29:31-08:00</authored-date>
  <message>Fix date formatting for IE7</message>
  <tree>1084af7c71a8b117a3ebe3ed03c41e539944255a</tree>
  <committer>
    <name>Kyle Neath</name>
    <email>kneath@gmail.com</email>
  </committer>
</commit>
