Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Selecting WorkWeek w/ attached DatePicker
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Selecting WorkWeek w/ attached DatePicker

 Post Reply Post Reply
Author
Message
dajv View Drop Down
Groupie
Groupie


Joined: 27 July 2004
Location: Australia
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote dajv Quote  Post ReplyReply Direct Link To This Post Topic: Selecting WorkWeek w/ attached DatePicker
    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.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
dajv View Drop Down
Groupie
Groupie


Joined: 27 July 2004
Location: Australia
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote dajv Quote  Post ReplyReply Direct Link To This Post Posted: 07 December 2005 at 3:44pm
That would be great, thanks.
Back to Top
dajv View Drop Down
Groupie
Groupie


Joined: 27 July 2004
Location: Australia
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote dajv Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
dajv View Drop Down
Groupie
Groupie


Joined: 27 July 2004
Location: Australia
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote dajv Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
dajv View Drop Down
Groupie
Groupie


Joined: 27 July 2004
Location: Australia
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote dajv Quote  Post ReplyReply Direct Link To This Post Posted: 15 December 2005 at 10:34pm
Ah i see. I didn't realise it was released first of this month.
Back to Top
jeffrowberg View Drop Down
Newbie
Newbie
Avatar

Joined: 30 December 2005
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffrowberg Quote  Post ReplyReply Direct Link To This Post 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


Back to Top
dajv View Drop Down
Groupie
Groupie


Joined: 27 July 2004
Location: Australia
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote dajv Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
dajv View Drop Down
Groupie
Groupie


Joined: 27 July 2004
Location: Australia
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote dajv Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.160 seconds.