Skip to content

Commit

Permalink
ax5core copy to assets
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasJang committed Jan 25, 2016
1 parent 21b4bac commit d419f8c
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 14 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,17 @@ exactly the path.
### Basic Usages
```js
var myCalendar = new ax5.ui.calendar();
myCalendar.setConfig();
myCalendar.setConfig({
target: document.getElementById("calendar-target"),
displayDate: (new Date()),
onClick: function () {
console.log(this);
console.log(myCalendar.getSelection());
},
onStateChanged: function () {
console.log(this);
}
});
```

- - -
Expand Down
2 changes: 1 addition & 1 deletion dist/ax5calendar.css

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions dist/ax5calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
}

})() + ' ' + (function () {
return ""; //( U.date(loopDate, {"return":"yyyymmdd"}) == U.date(cfg.displayDate, {"return":"yyyymmdd"}) ) ? "hover" : "";
return "";
})() + '" data-calendar-item-date="' + U.date(loopDate, {"return": cfg.dateFormat}) + '"><span class="addon"></span>'
+ cfg.lang.day.replace('%s', loopDate.getDate())
+ '<span class="lunar"></span></a>');
Expand Down Expand Up @@ -493,16 +493,18 @@

if (selectable) {
selectableCount = (cfg.multipleSelect) ? (U.isNumber(cfg.multipleSelect)) ? cfg.multipleSelect : 2 : 1;

console.log(selectableCount);

if (self.selection.length >= selectableCount) {
var removed = self.selection.splice(0, self.selection.length - (selectableCount - 1));
removed.forEach(function (d) {
self.$["body"].find('[data-calendar-item-date="' + U.date(d, {"return": cfg.dateFormat}) + '"]').removeClass("selected");
self.$["body"].find('[data-calendar-item-date="' + U.date(d, {"return": cfg.dateFormat}) + '"]').removeClass("selected-day");
});
}

jQuery(target).addClass("selected");
jQuery(target).addClass("selected-day");
self.selection.push(value);
// cfg.displayDate = value;

if (cfg.onClick)
{
Expand Down
2 changes: 1 addition & 1 deletion dist/ax5calendar.min.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions src/ax5calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
}

})() + ' ' + (function () {
return ""; //( U.date(loopDate, {"return":"yyyymmdd"}) == U.date(cfg.displayDate, {"return":"yyyymmdd"}) ) ? "hover" : "";
return "";
})() + '" data-calendar-item-date="' + U.date(loopDate, {"return": cfg.dateFormat}) + '"><span class="addon"></span>'
+ cfg.lang.day.replace('%s', loopDate.getDate())
+ '<span class="lunar"></span></a>');
Expand Down Expand Up @@ -493,16 +493,18 @@

if (selectable) {
selectableCount = (cfg.multipleSelect) ? (U.isNumber(cfg.multipleSelect)) ? cfg.multipleSelect : 2 : 1;

console.log(selectableCount);

if (self.selection.length >= selectableCount) {
var removed = self.selection.splice(0, self.selection.length - (selectableCount - 1));
removed.forEach(function (d) {
self.$["body"].find('[data-calendar-item-date="' + U.date(d, {"return": cfg.dateFormat}) + '"]').removeClass("selected");
self.$["body"].find('[data-calendar-item-date="' + U.date(d, {"return": cfg.dateFormat}) + '"]').removeClass("selected-day");
});
}

jQuery(target).addClass("selected");
jQuery(target).addClass("selected-day");
self.selection.push(value);
// cfg.displayDate = value;

if (cfg.onClick)
{
Expand Down
2 changes: 1 addition & 1 deletion src/scss/_ax5calendar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
}
}
}
&.selected {
&.selected-day {
@include ax-background($ax5calendar-hover-bg);
color: $ax5calendar-hover-text-color !important;
span.addon {
Expand Down
4 changes: 2 additions & 2 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>ㅔ목
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="../dist/ax5calendar.css"/>
Expand Down Expand Up @@ -69,7 +69,7 @@
onStateChanged: function () {
console.log(this);
}
//multipleSelect: 1
//, multipleSelect: 1
});

myCalendar.setSelection(['2016-01-11', '2016-01-12', '2016-01-13']);
Expand Down

0 comments on commit d419f8c

Please sign in to comment.