You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2010/04/24 13:07:00 UTC

svn commit: r937621 - in /click/trunk/click: documentation/docs/roadmap-changes.html extras/src/META-INF/resources/click/calendar/calendar_date_select.js

Author: sabob
Date: Sat Apr 24 11:07:00 2010
New Revision: 937621

URL: http://svn.apache.org/viewvc?rev=937621&view=rev
Log:
set seconds back to zero. CLK-644

Modified:
    click/trunk/click/documentation/docs/roadmap-changes.html
    click/trunk/click/extras/src/META-INF/resources/click/calendar/calendar_date_select.js

Modified: click/trunk/click/documentation/docs/roadmap-changes.html
URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/docs/roadmap-changes.html?rev=937621&r1=937620&r2=937621&view=diff
==============================================================================
--- click/trunk/click/documentation/docs/roadmap-changes.html (original)
+++ click/trunk/click/documentation/docs/roadmap-changes.html Sat Apr 24 11:07:00 2010
@@ -249,12 +249,6 @@ includes improved Ajax support and @Bind
         [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-647">CLK-647</a>].
       </li>
       <li class="change">
-        Fixed issue where RadioGroup label referenced a non-existing ID. RadioGroup
-        is now wrapped inside a span tag with the given ID. This issue was raised
-        and fixed by Finn Bock
-        [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-577">CLK-577</a>].
-      </li>
-      <li class="change">
         Replaced Page and Control getMessage methods with varargs equivalents
         [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-604">CLK-604</a>].
       </li>
@@ -274,6 +268,16 @@ includes improved Ajax support and @Bind
         [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-644">CLK-644</a>].
       </li>
       <li class="change">
+        Fixed issue where RadioGroup label referenced a non-existing ID. RadioGroup
+        is now wrapped inside a span tag with the given ID. This issue was raised
+        and fixed by Finn Bock
+        [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-577">CLK-577</a>].
+      </li>
+      <li class="change">
+        Fixed DateField to set seconds back to zero. This issue was raised by Andrey Rybin
+        [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-664">CLK-664</a>].
+      </li>
+      <li class="change">
           The menu.dtd has been published to
           <a href="http://click.apache.org/dtds/menu-2.2.dtd">http://click.apache.org/dtds/menu-2.2.dtd</a>.
           If you want your configuration to conform to the menu.dtd, include

Modified: click/trunk/click/extras/src/META-INF/resources/click/calendar/calendar_date_select.js
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/META-INF/resources/click/calendar/calendar_date_select.js?rev=937621&r1=937620&r2=937621&view=diff
==============================================================================
--- click/trunk/click/extras/src/META-INF/resources/click/calendar/calendar_date_select.js (original)
+++ click/trunk/click/extras/src/META-INF/resources/click/calendar/calendar_date_select.js Sat Apr 24 11:07:00 2010
@@ -69,7 +69,7 @@ Date.prototype.daysDistance = function(c
 Date.prototype.toFormattedString = function(include_time, format){
   var hour, str;
   str = Date.months[this.getMonth()] + " " + this.getDate() + ", " + this.getFullYear();
-  
+
   if (include_time) { hour = this.getHours(); str += " " + this.getAMPMHour() + ":" + this.getPaddedMinutes() + " " + this.getAMPM() }
   return str;
 }
@@ -141,17 +141,17 @@ CalendarDateSelect.prototype = {
   },
   positionCalendarDiv: function() {
     var above = false;
-    var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width; 
+    var c_pos = this.calendar_div.cumulativeOffset(), c_left = c_pos[0], c_top = c_pos[1], c_dim = this.calendar_div.getDimensions(), c_height = c_dim.height, c_width = c_dim.width;
     var w_top = window.f_scrollTop(), w_height = window.f_height();
     var e_dim = $(this.options.get("popup_by")).cumulativeOffset(), e_top = e_dim[1], e_left = e_dim[0], e_height = $(this.options.get("popup_by")).getDimensions().height, e_bottom = e_top + e_height;
-    
+
     if ( (( e_bottom + c_height ) > (w_top + w_height)) && ( e_bottom - c_height > w_top )) above = true;
     var left_px = e_left.toString() + "px", top_px = (above ? (e_top - c_height ) : ( e_top + e_height )).toString() + "px";
-    
+
     this.calendar_div.style.left = left_px;  this.calendar_div.style.top = top_px;
-    
+
     this.calendar_div.setStyle({visibility:""});
-    
+
     // draw an iframe behind the calendar -- ugly hack to make IE 6 happy
     if(navigator.appName=="Microsoft Internet Explorer") this.iframe = $(document.body).build("iframe", {src: "javascript:false", className: "ie6_blocker"}, { left: left_px, top: top_px, height: c_height.toString()+"px", width: c_width.toString()+"px", border: "0px"})
   },
@@ -164,19 +164,19 @@ CalendarDateSelect.prototype = {
       var style = { position:"absolute", visibility: "hidden", left:0, top:0 }
     }
     this.calendar_div = $(parent).build('div', {className: "calendar_date_select"}, style);
-    
+
     var that = this;
     // create the divs
     $w("top header body buttons footer bottom").each(function(name) {
       eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { clear: 'left'} ); ");
     });
-    
+
     this.initHeaderDiv();
     this.initButtonsDiv();
     this.initCalendarGrid();
     this.initFooterDiv();
     this.updateFooter("&#160;");
-    
+
     this.refresh();
     this.setUseTime(this.use_time);
   },
@@ -185,10 +185,10 @@ CalendarDateSelect.prototype = {
     this.close_button = header_div.build("a", { innerHTML: "x", href:"#", onclick:function () { this.close(); return false; }.bindAsEventListener(this), className: "close" });
     this.next_month_button = header_div.build("a", { innerHTML: "&gt;", href:"#", onclick:function () { this.navMonth(this.date.getMonth() + 1 ); return false; }.bindAsEventListener(this), className: "next" });
     this.prev_month_button = header_div.build("a", { innerHTML: "&lt;", href:"#", onclick:function () { this.navMonth(this.date.getMonth() - 1 ); return false; }.bindAsEventListener(this), className: "prev" });
-    
+
     if (this.options.get("month_year")=="dropdowns") {
-      this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: "month", onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)}); 
-      this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)}); 
+      this.month_select = new SelectBox(header_div, $R(0,11).map(function(m){return [Date.months[m], m]}), {className: "month", onchange: function () { this.navMonth(this.month_select.getValue()) }.bindAsEventListener(this)});
+      this.year_select = new SelectBox(header_div, [], {className: "year", onchange: function () { this.navYear(this.year_select.getValue()) }.bindAsEventListener(this)});
       this.populateYearRange();
     } else {
       this.month_year_label = header_div.build("span")
@@ -203,7 +203,7 @@ CalendarDateSelect.prototype = {
     Date.weekdays.each( function(weekday) {
       weekdays_row.build("th", {innerHTML: weekday});
     });
-    
+
     var days_tbody = days_table.build("tbody")
     // Make the days!
     var row_number = 0, weekday;
@@ -230,29 +230,29 @@ CalendarDateSelect.prototype = {
     {
       var blank_time = $A(this.options.get("time")=="mixed" ? [[" - ", ""]] : []);
       buttons_div.build("span", {innerHTML:"@", className: "at_sign"});
-      
+
       var t = new Date();
       this.hour_select = new SelectBox(buttons_div,
         blank_time.concat($R(0,23).map(function(x) {t.setHours(x); return $A([t.getAMPMHour()+ " " + t.getAMPM(),x])} )),
-        { 
-          calendar_date_select: this, 
+        {
+          calendar_date_select: this,
           onchange: function() { this.calendar_date_select.updateSelectedDate( { hour: this.value });},
-          className: "hour" 
+          className: "hour"
         }
       );
       buttons_div.build("span", {innerHTML:":", className: "seperator"});
       var that = this;
       this.minute_select = new SelectBox(buttons_div,
         blank_time.concat($R(0,59).select(function(x){return (x % that.options.get('minute_interval')==0)}).map(function(x){ return $A([ Date.padded2(x), x]); } ) ),
-        { 
-          calendar_date_select: this, 
-          onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) }, 
-          className: "minute" 
+        {
+          calendar_date_select: this,
+          onchange: function() { this.calendar_date_select.updateSelectedDate( {minute: this.value }) },
+          className: "minute"
         }
       );
-      
+
     } else if (! this.options.get("buttons")) buttons_div.remove();
-    
+
     if (this.options.get("buttons")) {
       buttons_div.build("span", {innerHTML: "&#160;"});
       if (this.options.get("time")=="mixed" || !this.options.get("time")) b = buttons_div.build("a", {
@@ -260,15 +260,15 @@ CalendarDateSelect.prototype = {
           href: "#",
           onclick: function() {this.today(false); return false;}.bindAsEventListener(this)
         });
-      
+
       if (this.options.get("time")=="mixed") buttons_div.build("span", {innerHTML: "&#160;|&#160;", className:"button_seperator"})
-      
+
       if (this.options.get("time")) b = buttons_div.build("a", {
         innerHTML: _translations["Now"],
         href: "#",
         onclick: function() {this.today(true); return false}.bindAsEventListener(this)
       });
-      
+
       if (!this.options.get("embedded") && !this.closeOnClick())
       {
         buttons_div.build("span", {innerHTML: "&#160;|&#160;", className:"button_seperator"})
@@ -290,7 +290,7 @@ CalendarDateSelect.prototype = {
   {
     this.refreshMonthYear();
     this.refreshCalendarGrid();
-    
+
     this.setSelectedClass();
     this.updateFooter();
   },
@@ -301,9 +301,9 @@ CalendarDateSelect.prototype = {
     var pre_days = this.beginning_date.getDay() // draw some days before the fact
     if (pre_days < 3) pre_days += 7;
     this.beginning_date.setDate(1 - pre_days + Date.first_day_of_week);
-    
+
     var iterator = new Date(this.beginning_date);
-    
+
     var today = new Date().stripTime();
     var this_month = this.date.getMonth();
     vdc = this.options.get("valid_date_check");
@@ -317,9 +317,9 @@ CalendarDateSelect.prototype = {
       if (vdc) { if (vdc(iterator.stripTime())) cell.removeClassName("disabled"); else cell.addClassName("disabled") };
       iterator.setDate( day + 1);
     }
-    
+
     if (this.today_cell) this.today_cell.removeClassName("today");
-    
+
     if ( $R( 0, 41 ).include(days_until = this.beginning_date.stripTime().daysDistance(today)) ) {
       this.today_cell = this.calendar_day_grid[days_until];
       this.today_cell.addClassName("today");
@@ -329,15 +329,15 @@ CalendarDateSelect.prototype = {
     var m = this.date.getMonth();
     var y = this.date.getFullYear();
     // set the month
-    if (this.options.get("month_year") == "dropdowns") 
+    if (this.options.get("month_year") == "dropdowns")
     {
       this.month_select.setValue(m, false);
-      
-      var e = this.year_select.element; 
+
+      var e = this.year_select.element;
       if (this.flexibleYearRange() && (!(this.year_select.setValue(y, false)) || e.selectedIndex <= 1 || e.selectedIndex >= e.options.length - 2 )) this.populateYearRange();
-      
+
       this.year_select.setValue(y);
-      
+
     } else {
       this.month_year_label.update( Date.months[m] + " " + y.toString()  );
     }
@@ -348,7 +348,7 @@ CalendarDateSelect.prototype = {
   yearRange: function() {
     if (!this.flexibleYearRange())
       return $R(this.options.get("year_range")[0], this.options.get("year_range")[1]);
-      
+
     var y = this.date.getFullYear();
     return $R(y - this.options.get("year_range"), y + this.options.get("year_range"));
   },
@@ -413,22 +413,23 @@ CalendarDateSelect.prototype = {
       t_selected_date.setYear(parts.get("year"));
       t_selected_date.setMonth(parts.get("month"));
       t_selected_date.setDate(parts.get("day"));
-      
+
       if (vdc && ! vdc(t_selected_date.stripTime())) { return false; }
       this.selected_date = t_selected_date;
       this.selection_made = true;
     }
-    
+
     if (!isNaN(parts.get("hour"))) this.selected_date.setHours(parts.get("hour"));
     if (!isNaN(parts.get("minute"))) this.selected_date.setMinutes( Math.floor_to_interval(parts.get("minute"), this.options.get("minute_interval")) );
-    if (parts.get("hour") === "" || parts.get("minute") === "") 
+    if (!isNaN(parts.get("second"))) this.selected_date.setSeconds(parts.get("second"));
+    if (parts.get("hour") === "" || parts.get("minute") === "")
       this.setUseTime(false);
     else if (!isNaN(parts.get("hour")) || !isNaN(parts.get("minute")))
       this.setUseTime(true);
-    
+
     this.updateFooter();
     this.setSelectedClass();
-    
+
     if (this.selection_made) this.updateValue();
     if (this.closeOnClick()) { this.close(); }
     if (via_click && !this.options.get("embedded")) {
@@ -458,7 +459,7 @@ CalendarDateSelect.prototype = {
     if (this.use_time && this.selected_date) { // only set hour/minute if a date is already selected
       var minute = Math.floor_to_interval(this.selected_date.getMinutes(), this.options.get("minute_interval"));
       var hour = this.selected_date.getHours();
-      
+
       this.hour_select.setValue(hour);
       this.minute_select.setValue(minute)
     } else if (this.options.get("time")=="mixed") {
@@ -472,8 +473,8 @@ CalendarDateSelect.prototype = {
   },
   today: function(now) {
     var d = new Date(); this.date = new Date();
-    var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes()});
-    if ( ! now ) o = o.merge({hour: "", minute:""});
+    var o = $H({ day: d.getDate(), month: d.getMonth(), year: d.getFullYear(), hour: d.getHours(), minute: d.getMinutes(), second:d.getSeconds()});
+    if ( ! now ) o = o.merge({hour: "", minute:"", second:""});
     this.updateSelectedDate(o, true);
     this.refresh();
   },