Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - DateDiff Function in the Calendar Sample
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DateDiff Function in the Calendar Sample

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


Joined: 16 August 2005
Location: United States
Status: Offline
Points: 31
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpcoffeyXXX Quote  Post ReplyReply Direct Link To This Post Topic: DateDiff Function in the Calendar Sample
    Posted: 24 May 2009 at 3:45pm
The use of the DateDiff function in the Calendar Sample application is baffling to me.  In the frmEditEvent in the Calendar sample, the following code is listed for the SetStartEnd function,

    If AllDay Then
cmbEndTime.Visible = False
cmbStartTime.Visible = False

If DateDiff("s", EndTime, 0) = 0 Then
EndDate = EndDate - 1
End If
End If
Also in the UpdateEventFromControls routine this code is listed,

    If chkAllDayEvent.Value = 1 Then
If DateDiff("s", TimeValue(EndTime), 0) = 0 Then
EndTime = EndTime + 1
End If
End If

Can someone clarify what this check is for?  I don't see why we have to add a day to the EndTime.  I don't understand why the DateDiff is being calculated against a value of 0.  I can understand that it is a comparison to see if there is a 0 value for EndTime, but why do they add the number 1 to the EndTime if the EndTime is indeed 0?  Why wouldn't they add a 1 to the StartTime instead?  Thanks for your feedback.

Sincerely,

John Coffey


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.172 seconds.