>>>>> Edgar Gonçalves <[EMAIL PROTECTED]> writes:
> On Saturday, Jim Ottaway wrote:
>>>>>>> Edgar Gonçalves <[EMAIL PROTECTED]> writes:
> (snip)
>> I think that if you want to do this, then others probably want to too,
>> so it would be good to include your changes to
>> planner-appt-forthcoming-get-appts.
>>
>> I imagine that you have changed it so that the start date can be
>> specified as well as the number of days?
> I don't have my repository online, for now. I hope to have it soon. Despite
> that, I'll post the new function here, along with both affected functions with
> the proper changes:
[snip code]
I'll have a look at those, later today probably.
> I still have one problem, that is related to the weekly-view production. Right
> now I have a function that collects the appts for 6 days, starting from the
> beginning of the week. My problem is how to get the right Monday date from
> (planner-today). There's a function that works with the calendar cursor, but
> that's no good, because it messes the weekly-view code. I'd like to calculate
> it, but didn't put much thought into it - I was hoping there was already a
> nice
> elisp function to do it for me! (Btw, if you want to test this, it already
> works, but only if calendar cursor is under a Monday!)
Does this work?:
(defun planner-beginning-of-week (planner-date)
(let ((date (planner-filename-to-calendar-date planner-date)))
(planner-date-to-filename
(calendar-gregorian-from-absolute
(+ (calendar-absolute-from-gregorian date)
(- calendar-week-start-day
(calendar-day-of-week date)))))))
It uses calendar-week-start-day for consistency with calendar [0 for
Sunday, 1 for Monday, etc.].
--
Jim Ottaway
_______________________________________________
emacs-wiki-discuss mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/emacs-wiki-discuss