In month view mark any days from the previous and next month differently

This commit is contained in:
Nathan Gray 2016-02-04 23:14:54 +00:00
parent 4b30283558
commit a42a66ee52
5 changed files with 36 additions and 5 deletions

View File

@ -358,6 +358,12 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea
}
},
set_class: function(classnames) {
this.header.removeClass(this.class);
this._super.apply(this, arguments);
this.header.addClass(classnames);
},
/**
* Callback used when the daywise data changes
*

View File

@ -885,7 +885,17 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
for(var i = 0; i < this.day_widgets.length; i++)
{
day = this.day_widgets[i];
// Classes
if(this.day_list[i] && parseInt(this.day_list[i].substr(4,2)) !== new Date(app.calendar.state.date).getUTCMonth()+1)
{
day.set_class('calendar_differentMonth');
}
else
{
day.set_class('');
}
// Position
day.set_left((day_width * i) + 'px');
if(daily_owner)
@ -968,7 +978,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
this.date_helper.set_value(end_date);
var end = this.date_helper.date.getTime();
var i = 1;
this.date_helper.set_value(start_date);
this.date_helper.set_value(new Date(start_date));
do
{

View File

@ -150,7 +150,7 @@ var et2_calendar_view = et2_valueWidget.extend(
}
var old_date = this.options.start_date;
this.options.start_date = this.date_helper.getValue();
this.options.start_date = new Date(this.date_helper.getValue());
if(old_date !== this.options.start_date && this.isAttached())
{
@ -189,7 +189,7 @@ var et2_calendar_view = et2_valueWidget.extend(
}
var old_date = this.options.end_date;
this.options.end_date = this.date_helper.getValue();
this.options.end_date = new Date(this.date_helper.getValue());
if(old_date !== this.options.end_date && this.isAttached())
{

View File

@ -391,6 +391,14 @@ Hide subsequent headers in week view with non-consolidated owners
background-color: white;
}
/* Days in a different month, but shown to fill out the week */
.calendar_calDayColHeader.calendar_differentMonth > * {
color: rgb(106, 106, 106);
}
.calendar_calDayCol.calendar_differentMonth {
background-color: rgba(200,200,200,0.1);
}
/* Daily sortable */
.calendar_calDayColHeader .ui-sortable-handle {
cursor: ew-resize;

View File

@ -11,7 +11,7 @@
* @package calendar
* @version $Id$
*/
/* $Id: app.css 54926 2016-02-04 21:05:31Z nathangray $ */
/* $Id: app.css 54927 2016-02-04 22:35:34Z nathangray $ */
/*Media print classes*/
@media print {
.th td,
@ -402,6 +402,13 @@ Hide subsequent headers in week view with non-consolidated owners
height: 20px;
background-color: white;
}
/* Days in a different month, but shown to fill out the week */
.calendar_calDayColHeader.calendar_differentMonth > * {
color: #6a6a6a;
}
.calendar_calDayCol.calendar_differentMonth {
background-color: rgba(200, 200, 200, 0.1);
}
/* Daily sortable */
.calendar_calDayColHeader .ui-sortable-handle {
cursor: ew-resize;