tpruvot / fullcalendar

Year view implementation
http://epsy.ldtp.net/fullcalendar/demos/
MIT License
83 stars 26 forks source link

Add classes fc-past and fc-future #2

Closed comproperty247 closed 10 years ago

comproperty247 commented 10 years ago

Is not quite a issue! Is just adding the classes for days in past and on future because at this moment just have 'fc-today'. I discover this fullcalendar some days ago and in the version v1.6.4(whitout year view) have those 2 classes and I start by adding some css styles for '.fc-past .fc-day-number'.

So as it is a small update, for who wants to do the pull request please do so.

In fullcalendar.js at line +-3004 on function updateCells() { is this: if (+d == +today && d.getMonth() == i) { cell.addClass(tm + '-state-highlight fc-today'); }

Please add this 6 lines :

else if (d < today) { cell.addClass('fc-past'); } else { cell.addClass('fc-future'); }

Final result: if (+d == +today && d.getMonth() == i) { cell.addClass(tm + '-state-highlight fc-today'); } else if (d < today) { cell.addClass('fc-past'); } else { cell.addClass('fc-future'); }

//-------------- Css can be updated for opacity for more browsers:

.fc-grid .fc-other-month .fc-day-number { /* IE 8 / -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; / IE 5-7 / filter: alpha(opacity=30); / Netscape / -moz-opacity: 0.3; / Safari 1.x */ -khtml-opacity: 0.3;

opacity: 0.3; }

And is all, folks ;-)

tpruvot commented 10 years ago

Thanks for the tip, ive added these 2 classes

comproperty247 commented 10 years ago

Great!