Difference between revisions of "Patch Calendar Show All-Day Events in Month View"
Jump to navigation
Jump to search
Hopspitfire (talk | contribs) (New page: This patch will modify the calendar application to show all day events in the month view of the application. It denotes days with all day events by changing the background of the cell to b...) |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
This patch will modify the calendar application to show all day events in the month view of the application. | This patch will modify the calendar application to show all day events in the month view of the application. | ||
− | It denotes days with all day events by | + | It denotes days with all day events by grey in the all view, and by the calendar color when viewing a specific calendar. |
<pre><nowiki> | <pre><nowiki> | ||
− | + | --- /tmp/month-assistant.js Fri Aug 28 12:51:48 2009 | |
− | + | +++ /usr/palm/applications/com.palm.app.calendar/app/controllers/month-assistant.js Fri Oct 23 12:37:41 2009 | |
− | + | @@ -27,12 +27,21 @@ | |
− | -- | + | this.scrollerModel = { scrollbars: false, mode: "vertical-snap", snapIndex: 0, snapElements: { y: [] } }; |
− | +++ /usr/palm/applications/com.palm.app.calendar/app/controllers/month-assistant.js | + | }, |
− | @@ - | + | |
− | + | - setupMonth: function(startDate, endDate, callbackfn) | |
− | + | + fullEvts: null, | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | + | ||
− | + | + | + setupMonth: function(startDate, endDate, callbackfn) |
− | + | + | { |
− | +Mojo.Log.info('month-assistant:getEventsCallback'); | + | - getCalendarService().getBusyDays(getCurrentCal(), startDate.getTime(), endDate.getTime(), callbackfn, this.controller); |
− | + | + | + getCalendarService().getEvents(getCurrentCal(),startDate.getTime(), endDate.getTime(), this.getEventsCallback.bind(this), this.controller, this.getEventsFailCallback, {useSlices: true}); |
− | + | + | + getCalendarService().getBusyDays(getCurrentCal(), startDate.getTime(), endDate.getTime(), callbackfn, this.controller); |
+ | }, | ||
+ | |||
+ | - buildViewHeader: function() | ||
+ | + getEventsCallback: function(resp) | ||
+ | + { | ||
+ | + //Mojo.Log.info('month-assistant:getEventsCallback'); | ||
+ | + this.fullEvts = resp.days; | ||
+ | + }, | ||
+ | + | ||
− | + | + buildViewHeader: function() | |
− | + | { | |
− | + | //Mojo.Log.info("month-assistant: buildViewHeader"); | |
− | @@ - | + | this.controller.get('mv_header_container1').update(Mojo.View.render({object: { viewPrefix: 'mv' }, template: 'shared/calendar_view_header'})); |
− | + | @@ -376,7 +385,11 @@ | |
− | + | var cls; | |
− | + | for (var i = 1; i < 8; i <<= 1) | |
− | + | + | { |
− | + | + | - if (day & (i << 3)) |
− | + | + | + if (this.fullEvts[d].allDayEvents.length > 0) |
− | + | + | + { |
− | + | + cls = "monthview-busy-time " + calStyle; | |
+ | + } | ||
+ | + else if (day & (i << 3)) | ||
+ | { | ||
+ | cls = "monthview-busy-time " + calStyle; | ||
+ | } | ||
− | + | </nowiki></pre> | |
− | + | ==Notes== | |
+ | Updated and working with 1.2.1 on 2009/10/23 by daventx |
Latest revision as of 04:27, 24 October 2009
This patch will modify the calendar application to show all day events in the month view of the application. It denotes days with all day events by grey in the all view, and by the calendar color when viewing a specific calendar.
--- /tmp/month-assistant.js Fri Aug 28 12:51:48 2009 +++ /usr/palm/applications/com.palm.app.calendar/app/controllers/month-assistant.js Fri Oct 23 12:37:41 2009 @@ -27,12 +27,21 @@ this.scrollerModel = { scrollbars: false, mode: "vertical-snap", snapIndex: 0, snapElements: { y: [] } }; }, - setupMonth: function(startDate, endDate, callbackfn) + fullEvts: null, + + setupMonth: function(startDate, endDate, callbackfn) { - getCalendarService().getBusyDays(getCurrentCal(), startDate.getTime(), endDate.getTime(), callbackfn, this.controller); + getCalendarService().getEvents(getCurrentCal(),startDate.getTime(), endDate.getTime(), this.getEventsCallback.bind(this), this.controller, this.getEventsFailCallback, {useSlices: true}); + getCalendarService().getBusyDays(getCurrentCal(), startDate.getTime(), endDate.getTime(), callbackfn, this.controller); }, - buildViewHeader: function() + getEventsCallback: function(resp) + { + //Mojo.Log.info('month-assistant:getEventsCallback'); + this.fullEvts = resp.days; + }, + + buildViewHeader: function() { //Mojo.Log.info("month-assistant: buildViewHeader"); this.controller.get('mv_header_container1').update(Mojo.View.render({object: { viewPrefix: 'mv' }, template: 'shared/calendar_view_header'})); @@ -376,7 +385,11 @@ var cls; for (var i = 1; i < 8; i <<= 1) { - if (day & (i << 3)) + if (this.fullEvts[d].allDayEvents.length > 0) + { + cls = "monthview-busy-time " + calStyle; + } + else if (day & (i << 3)) { cls = "monthview-busy-time " + calStyle; }
Notes
Updated and working with 1.2.1 on 2009/10/23 by daventx