mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-07-02 17:00:06 +08:00
Update to 2.1.1 - manual merge
This commit is contained in:
+28
-27
@@ -1,41 +1,42 @@
|
||||
|
||||
fcViews.basicWeek = BasicWeekView;
|
||||
/* A week view with simple day cells running horizontally
|
||||
----------------------------------------------------------------------------------------------------------------------*/
|
||||
// TODO: a WeekView mixin for calculating dates and titles
|
||||
|
||||
function BasicWeekView(element, calendar) { // TODO: do a WeekView mixin
|
||||
var t = this;
|
||||
|
||||
|
||||
// exports
|
||||
t.incrementDate = incrementDate;
|
||||
t.render = render;
|
||||
|
||||
|
||||
// imports
|
||||
BasicView.call(t, element, calendar, 'basicWeek');
|
||||
fcViews.basicWeek = BasicWeekView; // register this view
|
||||
|
||||
function BasicWeekView(calendar) {
|
||||
BasicView.call(this, calendar); // call the super-constructor
|
||||
}
|
||||
|
||||
|
||||
function incrementDate(date, delta) {
|
||||
return date.clone().stripTime().add('weeks', delta).startOf('week');
|
||||
}
|
||||
BasicWeekView.prototype = createObject(BasicView.prototype); // define the super-class
|
||||
$.extend(BasicWeekView.prototype, {
|
||||
|
||||
name: 'basicWeek',
|
||||
|
||||
|
||||
function render(date) {
|
||||
incrementDate: function(date, delta) {
|
||||
return date.clone().stripTime().add(delta, 'weeks').startOf('week');
|
||||
},
|
||||
|
||||
t.intervalStart = date.clone().stripTime().startOf('week');
|
||||
t.intervalEnd = t.intervalStart.clone().add('weeks', 1);
|
||||
|
||||
t.start = t.skipHiddenDays(t.intervalStart);
|
||||
t.end = t.skipHiddenDays(t.intervalEnd, -1, true);
|
||||
render: function(date) {
|
||||
|
||||
t.title = calendar.formatRange(
|
||||
t.start,
|
||||
t.end.clone().subtract(1), // make inclusive by subtracting 1 ms
|
||||
t.opt('titleFormat'),
|
||||
this.intervalStart = date.clone().stripTime().startOf('week');
|
||||
this.intervalEnd = this.intervalStart.clone().add(1, 'weeks');
|
||||
|
||||
this.start = this.skipHiddenDays(this.intervalStart);
|
||||
this.end = this.skipHiddenDays(this.intervalEnd, -1, true);
|
||||
|
||||
this.title = this.calendar.formatRange(
|
||||
this.start,
|
||||
this.end.clone().subtract(1), // make inclusive by subtracting 1 ms
|
||||
this.opt('titleFormat'),
|
||||
' \u2014 ' // emphasized dash
|
||||
);
|
||||
|
||||
t.renderBasic(1, t.getCellsPerWeek(), false);
|
||||
BasicView.prototype.render.call(this, 1, this.getCellsPerWeek(), false); // call the super-method
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user