Print Page | Close Window

Selecting WorkWeek w/ attached DatePicker

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=3363
Printed Date: 21 November 2024 at 9:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Selecting WorkWeek w/ attached DatePicker
Posted By: dajv
Subject: Selecting WorkWeek w/ attached DatePicker
Date Posted: 06 December 2005 at 11:26pm
I have attempted to write some code so that when the calendar attached to a datepicker is set to WorkWeek view, a single date selected the datepicker will select the (nearest) work week.

Since it is attached though (and this is a requirement), the calendar view changes to dayview when a single day is selected when a single day is selected on the DatePicker. Any code that tries to make it select the workweek is therefore obviously going to be of the "dodgy" nature.

I would think that since the DatePicker is attached to the calendar it can recognise that it has the view set to WorkWeek and could alter the selection appropriately. Can this be added in the next version? I wouldn't expect it to be a lot of work and its a pretty important thing to implement, since there is no way of doing it in code yet Outlook has this functionality.

Alternatively, I suppose you could provide an event for the DatePicker that would be like a _PreSelect event that would let you alter a selection before it gets sent to the Calendar. This would be a bit dodgy though. The first method would be best, for sure. Theres no reason it can't be smart enough to do that for work week view (as an option, of course).


Thanks.



Replies:
Posted By: sserge
Date Posted: 07 December 2005 at 3:43pm
Hi,

Thanks for a review and the suggestion. Will fix this issue for the next release.

--
WBR,
Serge


Posted By: dajv
Date Posted: 07 December 2005 at 3:44pm
That would be great, thanks.


Posted By: dajv
Date Posted: 15 December 2005 at 5:55pm
This doesn't seem to be fixed in 9.81... is there something I need to do to implement this?


Posted By: gshawn
Date Posted: 15 December 2005 at 7:59pm

Originally posted by dajv dajv wrote:

This doesn't seem to be fixed in 9.81... is there something I need to do to implement this?

I think he meant it will be fixed in the next version after 9.81... He posted this after v9.81 was released.



Posted By: dajv
Date Posted: 15 December 2005 at 9:43pm
I have tried again to implement this without success. It is impossible as far as I can gather. Please implement this very simple request in the DatePicker.


Posted By: dajv
Date Posted: 15 December 2005 at 10:34pm
Ah i see. I didn't realise it was released first of this month.


Posted By: jeffrowberg
Date Posted: 30 December 2005 at 5:33pm
I have come up with a cheap way to obtain this functionality by using a MonthView object (contained in standard MS common controls someplace, I don't remember which version).  If you are on a five-day view, clicking on a weekend will result in the five nearest work days being selected.  On a seven-day view, it just does what you would expect.  My code below also checks whether a single day was selected, so if you select multiple days on purpose, it doesn't reset your selection.  This would be easy to remove though.

I know using a MonthView object is inefficient, but it makes it easy to get the DayOfWeek value from the date.

For reference, "mViewType" is the view type (0 for 5-day, 1 for 7-day), and "DPick" is the date picker (duh).

Jeff

   If mViewType = 0 And DPick.Selection.Blocks(0).DateBegin = DPick.Selection.Blocks(0).dateEnd Then
        MView.Value = DPick.Selection.Blocks(0).DateBegin
        DPick.SelectRange DPick.Selection.Blocks(0).DateBegin - (MView.DayOfWeek - 2), DPick.Selection.Blocks(0).dateEnd + (6 - MView.DayOfWeek)
    End If
    If mViewType = 1 And DPick.Selection.Blocks(0).DateBegin = DPick.Selection.Blocks(0).dateEnd Then
        MView.Value = DPick.Selection.Blocks(0).DateBegin
        DPick.SelectRange DPick.Selection.Blocks(0).DateBegin - (MView.DayOfWeek - 1), DPick.Selection.Blocks(0).dateEnd + (7 - MView.DayOfWeek)
    End If




Posted By: dajv
Date Posted: 02 January 2006 at 3:47pm
Thanks jeffrowberg, but determining the dates that should be selected was the least of my problems. The real issue is that you have to "adjust" the selection on the date picker after the fact, and the way I use the datepicker and calendar thats not feasible.

Thanks though.


Posted By: dajv
Date Posted: 23 April 2006 at 9:56pm
Serge,

Is this present in 10.1? I can't see that it is.

Thanks.


Originally posted by sserge sserge wrote:

Hi,

Thanks for a review and the suggestion. Will fix this issue for the next release.

--
WBR,
Serge


Posted By: sserge
Date Posted: 25 April 2006 at 12:50pm
Check out version 10.1.1 -- if you switch to WorkWeek mode there, it will be kept so when you select a single day.

--
WBR,
Serge



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net