Skip to content

Commit

Permalink
Merge pull request #63 from kwl777/master
Browse files Browse the repository at this point in the history
fix 起始日期为0-24时的显示问题
  • Loading branch information
veryStarters committed Jun 10, 2019
2 parents 9f8aa0b + 6dbadf3 commit bd8ff16
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 87 deletions.
36 changes: 14 additions & 22 deletions demo/CalendarDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import RcCalendar from '../src/RcCalendar';
import Calendar from '../src';
import events from './events';

const {
MonthCalendar, YearCalendar, RangeCalendar, CalendarFull, MiniWeek,
} = Calendar;
const { MonthCalendar, YearCalendar, RangeCalendar, CalendarFull, MiniWeek } = Calendar;

function disabledDate(current) {
if (current) {
Expand Down Expand Up @@ -95,9 +93,9 @@ class Demo extends React.Component {
}

onScheduleClick = (e, schedule) => {
console.log(e, schedule)
alert(schedule.name)
}
console.log(e, schedule);
alert(schedule.name);
};

render() {
const me = this;
Expand Down Expand Up @@ -246,42 +244,36 @@ class Demo extends React.Component {
text: '19年1、2月份',
value: {
start: '2019-01',
end: '2019-02'
}
end: '2019-02',
},
},
{
text: '18年S2',
value: {
start: '2018-09',
end: '2019-03'
}
}
end: '2019-03',
},
},
]}
onSelect={(v, formatted) => {
this.onRangeSelect(v, formatted);
}}
/>
</div>
<div
className="kuma-form-field"
style={{
marginBottom: '30px',
width: '700px'
}}
>
<div className="kuma-form-field">
<p>
大日历日期选择,跨日程,提供Calendar.util.generateScheduleContent方法,返回具体日程的相关信息
</p>
<CalendarFull
value={value}
onSelect={this.onSelect}
fullscreen
type="month"
type="week"
locale="zh-cn"
format="yyyy/MM/dd"
scheduleRender={Calendar.fullUtil.generateScheduleContent(events, this.onScheduleClick)}
startHour={8}
endHour={18}
startHour={0}
endHour={24}
step={60}
/>
<MiniWeek
Expand All @@ -293,7 +285,7 @@ class Demo extends React.Component {
/>
<div
className="miniweek-container"
ref={(c) => {
ref={c => {
this.miniRender = c;
}}
/>
Expand Down
15 changes: 11 additions & 4 deletions demo/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,22 @@ export default [
render: () => <div>事件3</div>,
},
{
start: '2019-06-01 14:00', // 事件开始时间
end: '2019-06-02 21:00', // 事件结束时间
start: '2019-06-05 00:00', // 事件开始时间
end: '2019-06-06 21:00', // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件3</div>,
},
{
start: '2019-05-12 14:00', // 事件开始时间
end: '2019-06-10 21:00', // 事件结束时间
start: '2019-06-05 14:00', // 事件开始时间
end: '2019-06-05 21:00', // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件3</div>,
},
{
start: '2019-06-04 01:00', // 事件开始时间
end: '2019-06-04 24:00', // 事件结束时间
important: true,
// 事件的渲染函数
render: () => <div>事件3</div>,
Expand Down

0 comments on commit bd8ff16

Please sign in to comment.