mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-17 11:19:14 +08:00
moment-2.8 compatibility, source (2.0), .add() calls
This commit is contained in:
@@ -15,7 +15,7 @@ function BasicDayView(element, calendar) { // TODO: make a DayView mixin
|
||||
|
||||
|
||||
function incrementDate(date, delta) {
|
||||
var out = date.clone().stripTime().add('days', delta);
|
||||
var out = date.clone().stripTime().add(delta, 'days');
|
||||
out = t.skipHiddenDays(out, delta < 0 ? -1 : 1);
|
||||
return out;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ function BasicDayView(element, calendar) { // TODO: make a DayView mixin
|
||||
function render(date) {
|
||||
|
||||
t.start = t.intervalStart = date.clone().stripTime();
|
||||
t.end = t.intervalEnd = t.start.clone().add('days', 1);
|
||||
t.end = t.intervalEnd = t.start.clone().add(1, 'days');
|
||||
|
||||
t.title = calendar.formatDate(t.start, t.opt('titleFormat'));
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ function BasicView(element, calendar, viewName) {
|
||||
|
||||
|
||||
function defaultSelectionEnd(start) {
|
||||
return start.clone().stripTime().add('days', 1);
|
||||
return start.clone().stripTime().add(1, 'days');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,14 +15,14 @@ function BasicWeekView(element, calendar) { // TODO: do a WeekView mixin
|
||||
|
||||
|
||||
function incrementDate(date, delta) {
|
||||
return date.clone().stripTime().add('weeks', delta).startOf('week');
|
||||
return date.clone().stripTime().add(delta, 'weeks').startOf('week');
|
||||
}
|
||||
|
||||
|
||||
function render(date) {
|
||||
|
||||
t.intervalStart = date.clone().stripTime().startOf('week');
|
||||
t.intervalEnd = t.intervalStart.clone().add('weeks', 1);
|
||||
t.intervalEnd = t.intervalStart.clone().add(1, 'weeks');
|
||||
|
||||
t.start = t.skipHiddenDays(t.intervalStart);
|
||||
t.end = t.skipHiddenDays(t.intervalEnd, -1, true);
|
||||
|
||||
@@ -15,14 +15,14 @@ function MonthView(element, calendar) {
|
||||
|
||||
|
||||
function incrementDate(date, delta) {
|
||||
return date.clone().stripTime().add('months', delta).startOf('month');
|
||||
return date.clone().stripTime().add(delta, 'months').startOf('month');
|
||||
}
|
||||
|
||||
|
||||
function render(date) {
|
||||
|
||||
t.intervalStart = date.clone().stripTime().startOf('month');
|
||||
t.intervalEnd = t.intervalStart.clone().add('months', 1);
|
||||
t.intervalEnd = t.intervalStart.clone().add(1, 'months');
|
||||
|
||||
t.start = t.intervalStart.clone();
|
||||
t.start = t.skipHiddenDays(t.start); // move past the first week if no visible days
|
||||
@@ -31,14 +31,14 @@ function MonthView(element, calendar) {
|
||||
|
||||
t.end = t.intervalEnd.clone();
|
||||
t.end = t.skipHiddenDays(t.end, -1, true); // move in from the last week if no visible days
|
||||
t.end.add('days', (7 - t.end.weekday()) % 7); // move to end of week if not already
|
||||
t.end.add((7 - t.end.weekday()) % 7, 'days'); // move to end of week if not already
|
||||
t.end = t.skipHiddenDays(t.end, -1, true); // move in from the last invisible days of the week
|
||||
|
||||
var rowCnt = Math.ceil( // need to ceil in case there are hidden days
|
||||
t.end.diff(t.start, 'weeks', true) // returnfloat=true
|
||||
);
|
||||
if (t.opt('weekMode') == 'fixed') {
|
||||
t.end.add('weeks', 6 - rowCnt);
|
||||
t.end.add(6 - rowCnt, 'weeks');
|
||||
rowCnt = 6;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user