|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How do I calculate the date of the previous day given a date ( in "MM/dd/yy" format)user input ( to a valid date in date format - validity is checkedsomewhere else), the arrival date is set to the previous date upon MouseLeave. How do I calculate the date of the previous day (see mdatArrivalDate = ???? )? (I have already done calculating departure date when an arrrivalDate is modified manually - not via selecting on calendar - to valid data by usind AddDay(1).) Any help? Private Sub txtADepartureDate_KeyPress(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles _ txtDepartureDate.KeyPress If txtDepartureDate.Modified Then If Not IsDate(txtDepartureDate.Text) Then txtDepartureDate.Text = mdatDepartureDate.ToString Else mdatDepartureDate = CDate(txtDepartureDate.Text) mdatArrivalDate = ???? (I need the date of previous day ) mshrNightStayed = 1 txtArrivalDate.Text = mdatArrivalDate.ToString End If 'Not IsDate(txtDepartureDate.Text) End If ' txtDepartureDate.Modified End Sub DateTime.AddDays(-1)
Amanda wrote: Show quoteHide quote > This is hotel reservation when a departure date is changed manually by > user input ( to a valid date in date format - validity is > checkedsomewhere else), the arrival date is set to the previous date > upon MouseLeave. How do I calculate the date of the previous day (see > mdatArrivalDate = ???? )? > > (I have already done calculating departure date when an arrrivalDate is > modified manually - not via selecting on calendar - to valid data by > usind AddDay(1).) > > Any help? > > > > Private Sub txtADepartureDate_KeyPress(ByVal sender As Object, _ > ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles _ > txtDepartureDate.KeyPress > > If txtDepartureDate.Modified Then > > If Not IsDate(txtDepartureDate.Text) Then > txtDepartureDate.Text = mdatDepartureDate.ToString > Else > mdatDepartureDate = CDate(txtDepartureDate.Text) > > mdatArrivalDate = ???? (I need the date of previous day ) > > mshrNightStayed = 1 > txtArrivalDate.Text = mdatArrivalDate.ToString > End If 'Not IsDate(txtDepartureDate.Text) > > End If ' txtDepartureDate.Modified > > End Sub
class library
Locating Windows Application Installation Keys Something I don't quite understand about "file in use by another process" exceptions..... How to Load string into mshtml object? Detect WiFi Networks what method to use to add 1 day to a date (hotel reservation for one night by clicking on calender) Adding rows to a data table: Rows do not show up PLEASE HELP - Executable properties - right click Variable precision Saving color changes for next login |
|||||||||||||||||||||||