Permalink
Browse files

Removed debug printout

  • Loading branch information...
1 parent 6682741 commit 74f1f1b3b241fcf09da2e9448fb63c30151fcfba @eliasson committed Feb 2, 2012
Showing with 2 additions and 3 deletions.
  1. +1 −1 jquery.day.css
  2. +0 −1 jquery.day.js
  3. +1 −1 jquery.day.min.js
View
2 jquery.day.css
@@ -1,7 +1,7 @@
/**
* Day - A jQuery date picker
*
- * Copyright (C) 2011 by Markus Eliasson
+ * Copyright (C) 2012 by Markus Eliasson
*
* Licensed under the MIT license
*/
View
1 jquery.day.js
@@ -27,7 +27,6 @@
}
$(this).click(function() {
- console.log("Click");
if($.fn.day.picker !== undefined) {
$($.fn.day.picker).fadeOut('fast', function() {
$($.fn.day.picker).remove();
View
2 jquery.day.min.js
@@ -1 +1 @@
-(function(a){function b(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);for(var c=0;c<b.length;c++){var d=new RegExp("\\{"+c+"\\}","gi");a=a.replace(d,b[c])}return a}a.fn.day=function(b){return a.fn.day.month_names=["January","February","March","April","May","June","July","August","September","October","November","December"],a.fn.day.weekday_names=["MO","TU","WE","TH","FR","SA","SU"],this.each(function(){var c=a(this),d=c.data("daydata");if(!d){var e=new Date;d={current_date:new Date,current_year:e.getFullYear(),current_month:e.getMonth(),visible:!1},c.data("daydata",d)}a(this).click(function(){console.log("Click"),a.fn.day.picker!==undefined&&a(a.fn.day.picker).fadeOut("fast",function(){a(a.fn.day.picker).remove(),visible=!1}),event.stopPropagation(),a.fn.day.picker=build_picker_markup(c,d,b),a.fn.day.picker.click(function(a){a.stopPropagation()}),a("html").click(function(){a(a.fn.day.picker).fadeOut("fast",function(){a(a.fn.day.picker).remove(),d.visible=!1})})})})},is_leap=function(a){return a%4===0&&a%100!==0||a%400===0},days_in_month=function(a,b){if(b===1)return is_leap(a)?29:28;var c=[31,28,31,30,31,30,31,31,30,31,30,31];return c[b]},build_picker_markup=function(c,d,e){var f='<div class="popup_day_selector"><table><thead><tr class="day_header"><td><a href="#" class="date_prev">&lt;</a></td>',g='<th colspan="5" class="day_month">{0}</th>',h='<td><a href="#" class="date_next">&gt;</a></td></tr><tr>',i="<th>{0}</th>",j="</tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>",k="</tbody></table></div>",l=a.fn.day.month_names[d.current_month]+" "+d.current_year;picker_code=f+b(g,l)+h;for(var m=0;m<a.fn.day.weekday_names.length;m++)picker_code+=b(i,a.fn.day.weekday_names[m]);picker_code+=j+k,a(c).after(picker_code);var n=a(c).siblings(".popup_day_selector");return update_picker(n,d,e),d.visible=!0,n.find("a.date_prev").click(function(){d.current_month>0?d.current_month--:(d.current_month=11,d.current_year--),d.current_date=new Date(d.current_year,d.current_month,1),update_picker(n,d,e)}),n.find("a.date_next").click(function(){d.current_month<11?d.current_month++:(d.current_month=0,d.current_year++),d.current_date=new Date(d.current_year,d.current_month,1),update_picker(n,d,e)}),c.data("daydata",d),n},update_picker=function(c,d,e){var f=new Date(d.current_date.getFullYear(),d.current_date.getMonth(),1),g=c.find("th.day_month");g.html(a.fn.day.month_names[d.current_month]+" "+d.current_year);var h=f.getDay()-1;h===-1&&(h=6);var i=days_in_month(d.current_year,d.current_month),j=days_in_month(f.getMonth()?f.getFullYear():f.getFullYear()-1,f.getMonth()?f.getMonth()-1:f.getMonth()),k=h,l=[];for(var m=k;m>0;m--)l.push(j-m+1);for(var m=0;m<i;m++)l.push(m+1);var n=0;while(l.length%7!=0)l.push(++n);var o=c.find("tbody");o.empty(),o.append("<tr></tr>");for(var m=0;m<l.length;m++){m%7===0&&m<l.length&&o.append("<tr></tr>");var p="";if(m<k||m>=i+k)p="date_off";var q=o.find("tr:last").append(b('<td class="{0}">{1}</td>',p,l[m])).find("td:last");q.click(function(){var b=a(this).text();a(this).hasClass("date_off")&&(parseInt(b)>15?d.current_month>0?d.current_month--:(d.current_month=11,d.current_year--):d.current_month<11?d.current_month++:(d.current_month=0,d.current_year++),d.current_date=new Date(d.current_year,d.current_month,1));var c=new Date(d.current_date.getFullYear(),d.current_date.getMonth(),b);a(a.fn.day.picker).fadeOut("fast",function(){a(a.fn.day.picker).remove(),d.visible=!1,e(c)})})}}})(jQuery);
+(function(a){function b(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);for(var c=0;c<b.length;c++){var d=new RegExp("\\{"+c+"\\}","gi");a=a.replace(d,b[c])}return a}a.fn.day=function(b){return a.fn.day.month_names=["January","February","March","April","May","June","July","August","September","October","November","December"],a.fn.day.weekday_names=["MO","TU","WE","TH","FR","SA","SU"],this.each(function(){var c=a(this),d=c.data("daydata");if(!d){var e=new Date;d={current_date:new Date,current_year:e.getFullYear(),current_month:e.getMonth(),visible:!1},c.data("daydata",d)}a(this).click(function(){a.fn.day.picker!==undefined&&a(a.fn.day.picker).fadeOut("fast",function(){a(a.fn.day.picker).remove(),visible=!1}),event.stopPropagation(),a.fn.day.picker=build_picker_markup(c,d,b),a.fn.day.picker.click(function(a){a.stopPropagation()}),a("html").click(function(){a(a.fn.day.picker).fadeOut("fast",function(){a(a.fn.day.picker).remove(),d.visible=!1})})})})},is_leap=function(a){return a%4===0&&a%100!==0||a%400===0},days_in_month=function(a,b){if(b===1)return is_leap(a)?29:28;var c=[31,28,31,30,31,30,31,31,30,31,30,31];return c[b]},build_picker_markup=function(c,d,e){var f='<div class="popup_day_selector"><table><thead><tr class="day_header"><td><a href="#" class="date_prev">&lt;</a></td>',g='<th colspan="5" class="day_month">{0}</th>',h='<td><a href="#" class="date_next">&gt;</a></td></tr><tr>',i="<th>{0}</th>",j="</tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>",k="</tbody></table></div>",l=a.fn.day.month_names[d.current_month]+" "+d.current_year;picker_code=f+b(g,l)+h;for(var m=0;m<a.fn.day.weekday_names.length;m++)picker_code+=b(i,a.fn.day.weekday_names[m]);picker_code+=j+k,a(c).after(picker_code);var n=a(c).siblings(".popup_day_selector");return update_picker(n,d,e),d.visible=!0,n.find("a.date_prev").click(function(){d.current_month>0?d.current_month--:(d.current_month=11,d.current_year--),d.current_date=new Date(d.current_year,d.current_month,1),update_picker(n,d,e)}),n.find("a.date_next").click(function(){d.current_month<11?d.current_month++:(d.current_month=0,d.current_year++),d.current_date=new Date(d.current_year,d.current_month,1),update_picker(n,d,e)}),c.data("daydata",d),n},update_picker=function(c,d,e){var f=new Date(d.current_date.getFullYear(),d.current_date.getMonth(),1),g=c.find("th.day_month");g.html(a.fn.day.month_names[d.current_month]+" "+d.current_year);var h=f.getDay()-1;h===-1&&(h=6);var i=days_in_month(d.current_year,d.current_month),j=days_in_month(f.getMonth()?f.getFullYear():f.getFullYear()-1,f.getMonth()?f.getMonth()-1:f.getMonth()),k=h,l=[];for(var m=k;m>0;m--)l.push(j-m+1);for(var m=0;m<i;m++)l.push(m+1);var n=0;while(l.length%7!=0)l.push(++n);var o=c.find("tbody");o.empty(),o.append("<tr></tr>");for(var m=0;m<l.length;m++){m%7===0&&m<l.length&&o.append("<tr></tr>");var p="";if(m<k||m>=i+k)p="date_off";var q=o.find("tr:last").append(b('<td class="{0}">{1}</td>',p,l[m])).find("td:last");q.click(function(){var b=a(this).text();a(this).hasClass("date_off")&&(parseInt(b)>15?d.current_month>0?d.current_month--:(d.current_month=11,d.current_year--):d.current_month<11?d.current_month++:(d.current_month=0,d.current_year++),d.current_date=new Date(d.current_year,d.current_month,1));var c=new Date(d.current_date.getFullYear(),d.current_date.getMonth(),b);a(a.fn.day.picker).fadeOut("fast",function(){a(a.fn.day.picker).remove(),d.visible=!1,e(c)})})}}})(jQuery);

0 comments on commit 74f1f1b

Please sign in to comment.