Skip to content

Commit

Permalink
Merge branch 'hotfix/#1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrice committed Nov 14, 2014
2 parents e98351e + 7a66c23 commit ea7f5a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zdk-calendar",
"version": "0.1.0",
"version": "0.1.1",
"authors": [
"Fabrice <[email protected]>"
],
Expand Down
22 changes: 11 additions & 11 deletions zdk-calendar.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
if( this.stop && fday.format("X") > this.stop ) {
div.classList.add("disable");
}
div.addEventListener("click",function(){ that.dateClick(this.getAttribute("data-date")) },false);

div.addEventListener("click",function(evt){ that.dateClick(evt, this.getAttribute("data-date")) },false);

weekdiv.appendChild(div);
fday.add('d',1);
}
Expand Down Expand Up @@ -107,21 +107,21 @@
day.classList.remove("today");
day.classList.remove("d1");
day.classList.remove("disable");

day.innerHTML = fday.date();

if(fday.year()==today.year() && fday.month()==today.month() && fday.date()==today.date() ) {
day.classList.add("today");
}
if(fday.month()!=that.day.month()) day.classList.add("d1");

if( that.start && fday.format("X") < that.start ) {
day.classList.add("disable");
}
if( that.stop && fday.format("X") > that.stop ) {
day.classList.add("disable");
}

day.setAttribute("data-date",fday.format("YYYY-MM-DD"));
fday.add('d',1);
});
Expand All @@ -133,17 +133,17 @@
},
startChanged: function(oldValue, newValue) {
if( this.start === newValue) { return; }
if(newValue) {
this.start = moment(newValue).format("X");
if(newValue) {
this.start = moment(newValue).format("X");
} else {
this.start = null;
}
this.update();
},
stopChanged: function(oldValue, newValue) {
if( this.stop === newValue) { return; }
if(newValue) {
this.stop = moment(newValue).format("X");
if(newValue) {
this.stop = moment(newValue).format("X");
} else {
this.stop = null;
}
Expand Down Expand Up @@ -189,7 +189,7 @@
this.update();
this.fire('dateChange', this.day.valueOf());
},
dateClick: function(day) {
dateClick: function(event, day) {
event.preventDefault();
moment.lang(this.i18n);
var selectedDay = moment(day).format("X")
Expand Down

0 comments on commit ea7f5a0

Please sign in to comment.