Print Page | Close Window

How do I specify a wndDatePicker date range?

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=14237
Printed Date: 25 April 2024 at 2:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How do I specify a wndDatePicker date range?
Posted By: Jaymeister
Subject: How do I specify a wndDatePicker date range?
Date 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!



Replies:
Posted By: Jaymeister
Date 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!


Posted By: Jaymeister
Date 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 :)



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