@aleen42/calendar 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/demo.html CHANGED
@@ -47,47 +47,49 @@
47
47
 
48
48
  function initCalendar(viewType) {
49
49
  Calendar(
50
- [$('.cal-content').attr('class', 'cal-content'), $('.cal-aside > .j-datepicker')],
51
- viewType,
52
- {
53
- load : (function (start, end, searchParams) {
54
- var data = [];
55
- if (searchParams) {
56
- data = data.concat(mock(new Date()));
57
- } else {
58
- start = new Date(start);
59
- end = new Date(end);
60
- var currentDate = new Date(start);
61
- currentDate.setHours(0, 0, 0, 0);
50
+ [$('.cal-content').attr('class', 'cal-content'), $('.cal-aside > .j-datepicker')],
51
+ viewType,
52
+ {
53
+ supportInvite : true,
54
+ supportExceptions : true,
55
+ load : (function (start, end, searchParams) {
56
+ var data = [];
57
+ if (searchParams) {
58
+ data = data.concat(mock(new Date()));
59
+ } else {
60
+ start = new Date(start);
61
+ end = new Date(end);
62
+ var currentDate = new Date(start);
63
+ currentDate.setHours(0, 0, 0, 0);
62
64
 
63
- while (currentDate <= end) {
64
- data.push({date : isoDate(currentDate), events : mock(currentDate)});
65
- currentDate.setDate(currentDate.getDate() + 1);
65
+ while (currentDate <= end) {
66
+ data.push({date : isoDate(currentDate), events : mock(currentDate)});
67
+ currentDate.setDate(currentDate.getDate() + 1);
68
+ }
66
69
  }
67
- }
68
70
 
69
- return Promise.resolve(data);
70
- }),
71
- viewBubble : (event, $target) => {
72
- alert(JSON.stringify(event));
73
- },
74
- aside : localStorage.getItem('aside') === 'true',
75
- onToggleAside : function (display) {
76
- return localStorage.setItem('aside', display);
77
- },
78
- limit: 1,
79
- }
71
+ return Promise.resolve(data);
72
+ }),
73
+ viewBubble : (event, $target) => {
74
+ alert(JSON.stringify(event));
75
+ },
76
+ aside : localStorage.getItem('aside') === 'true',
77
+ onToggleAside : function (display) {
78
+ return localStorage.setItem('aside', display);
79
+ },
80
+ limit : 1,
81
+ }
80
82
  )
81
83
 
82
84
  $('[data-type="' + viewType + '"]', $('.cal-content .toolbar').append(
83
- $('<div class="u-btns f-fr f-mgr">').html([
84
- '<div data-type=DAY class="u-btn u-btn-default">Day</div>',
85
- '<div data-type=WEEK class="u-btn u-btn-default">Week</div>',
86
- '<div data-type=MONTH class="u-btn u-btn-default">Month</div>',
87
- '<div data-type=LIST class="u-btn u-btn-default">Event</div>'
88
- ]).on('click', '[data-type]', function () {
89
- initCalendar($(this).data().type);
90
- })
85
+ $('<div class="u-btns f-fr f-mgr">').html([
86
+ '<div data-type=DAY class="u-btn u-btn-default">Day</div>',
87
+ '<div data-type=WEEK class="u-btn u-btn-default">Week</div>',
88
+ '<div data-type=MONTH class="u-btn u-btn-default">Month</div>',
89
+ '<div data-type=LIST class="u-btn u-btn-default">Event</div>'
90
+ ]).on('click', '[data-type]', function () {
91
+ initCalendar($(this).data().type);
92
+ })
91
93
  )).addClass('active');
92
94
  }
93
95
 
@@ -104,7 +106,7 @@
104
106
  return seed < 0.7 ? new Array(Math.floor(seed * 10)).fill('').map((_, i) => ({
105
107
  bodyType : 0,
106
108
  meetingStatus : 0,
107
- attendees : [],
109
+ attendees : ['a@b.cn'],
108
110
  isDraft : false,
109
111
  start : dateStr + ' 00:00:00',
110
112
  body : 'xxx-' + id,
@@ -119,7 +121,8 @@
119
121
  isOutOfDate : isOutOfDate,
120
122
  rangeStart : dateStr + ' 00:00:00',
121
123
  rangeExpired : isOutOfDate,
122
- checkCode : 0
124
+ checkCode : 0,
125
+ sensitivity : 2,
123
126
  })) : [];
124
127
  }
125
128
  </script>