Skip to content

Commit

Permalink
Merge pull request #52 from ElemeFE/build
Browse files Browse the repository at this point in the history
fixed #51
  • Loading branch information
youngerheart committed Jan 9, 2016
2 parents 4a7045b + 1735382 commit cf57ec7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Include js in `/dist` by tag , you can also require js by `require('date-range-p
var configs1 = {
lang: 'zh-cn', // using language
numberOfCalendars: 1, // displaying month number
calendarType: 'day', // type of calendar, day, week or month, dafault 'day'
type: 'single', // single, range, terminal
time: true, // want display & ctrl hours and minutes or not
date: moment('2015-10-01 23:33'), // default date for type single
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "date-range-picker",
"version": "0.2.4",
"version": "0.2.5",
"description": "a simple daterangepicker",
"main": "dist/daterangepicker.min.js",
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ class Calendar{
constructor(that, callback) {
// 渲染header, 再渲染多个月份的日历
var {el, config} = that;
var {numberOfCalendars, lang, maxDate, minDate, calendar} = config;
var {numberOfCalendars, lang, maxDate, minDate, calendarType} = config;
this.el = createElement('div', 'drp-calendar');
this.unitEl = null;
this.parent = el;
this.calNum = numberOfCalendars;
this.type = calendar || 'day';
this.type = calendarType || 'day';
this.current = that.range
? moment(that.range.start)
: that.date ? moment(that.date) : moment();
Expand Down Expand Up @@ -43,7 +43,8 @@ class Calendar{
this.drawPointer();
for(var i = 0; i < this.calNum; i++) {
this.unitEl = createElement('div', 'drp-unit');
this.current = this.current.date(1).add(1, 'month');
if(!this.isMonth) this.current = this.current.date(1).add(1, 'month');
else this.current = this.current.month(0).date(1).add(1, 'year');
this.drawHeader(i);
this.isMonth ? this.drawYear() : this.drawMonth();
this.el.appendChild(this.unitEl);
Expand Down
3 changes: 2 additions & 1 deletion src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}

.drp-week.longer .drp-day {
width: 155px;
width: 175px;
.drp-day-number, .drp-day-static {
width: 100%;
}
Expand Down Expand Up @@ -281,4 +281,5 @@

.drp-unit {
display: inline-block;
width: 100%;
}

0 comments on commit cf57ec7

Please sign in to comment.