Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - How do I specify a wndDatePicker date range?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How do I specify a wndDatePicker date range?

 Post Reply Post Reply
Author
Message
Jaymeister View Drop Down
Groupie
Groupie
Avatar

Joined: 27 April 2009
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jaymeister Quote  Post ReplyReply Direct Link To This Post Topic: How do I specify a wndDatePicker date range?
    Posted: 07 May 2009 at 10:17am
I can read a selected date range
  Dim D1 As Date, D2 As Date

  D1 = DateSerial(2009, 8, 31)
  D2 = DateSerial(2009, 8, 31)
 
  wndDatePicker.SelectRange D1, D2

How do I specify a date range?

Thanks for any help in advance!
Back to Top
Jaymeister View Drop Down
Groupie
Groupie
Avatar

Joined: 27 April 2009
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jaymeister Quote  Post ReplyReply Direct Link To This Post Posted: 07 May 2009 at 10:18am
SORRY - got above post topsy-turvy

I can set a selected date range
  Dim D1 As Date, D2 As Date

  D1 = DateSerial(2009, 8, 31)
  D2 = DateSerial(2009, 8, 31)
 
  wndDatePicker.SelectRange D1, D2

How do READ currently set date range?



Thanks for any help in advance!
Back to Top
Jaymeister View Drop Down
Groupie
Groupie
Avatar

Joined: 27 April 2009
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jaymeister Quote  Post ReplyReply Direct Link To This Post Posted: 13 May 2009 at 6:01am
modded a post I found here... ( https://forum.codejock.com/forum_posts.asp?TID=13251&KW=datepicker&PN=1 )

Sub GetDatePickerSelectedStartStopDates(D1 As Date, D2 As Date)
  Dim SelectDays() As Date
  CalcSelectDays NbDays&, SelectDays()
  D1 = SelectDays(1)
  D2 = SelectDays(NbDays&)
end sub

Sub CalcSelectDays(NbDays As Long, SelectDays() As Date)
Dim i As Long
    NbDays = 0
    ReDim SelectDays(NbDays)
  
    With wndDatePicker.Selection
    For i = 0 To .BlocksCount - 1
        AddSelectDays .Blocks(i).DateBegin, .Blocks(i).DateEnd, NbDays, SelectDays()
    Next
    End With
End Sub
 
Sub AddSelectDays(DateBegin As Date, DateEnd As Date, Nb As Long, SelDays() As Date)
Dim Day As Date
    Day = DateBegin
    Do
        Nb = Nb + 1
        ReDim Preserve SelDays(Nb)
        SelDays(Nb) = Day
        Day = DateAdd("d", 1, Day)
    Loop Until Day > DateEnd
End Sub

...and it works :)
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.063 seconds.