/ Forums / Advansys Formativ / Creating Solutions with Formativ / Appointment duration from DateTime controls / Reply To: Appointment duration from DateTime controls


So the good news is that this code runs without error:

isoTimePeriodBegin = objIniFile.ReadString(“Section”, “advTimePeriodBegin”, “”)
isoTimePeriodEnd = objIniFile.ReadString(“Section”, “advTimePeriodEnd”, “”)

datetimeTimePeriodBegin = Utilities.ISOToDate(isoTimePeriodBegin)
datetimeTimePeriodEnd = Utilities.ISOToDate(isoTimePeriodEnd)

NewTimeRecord.DatePicker.Date = datetimeTimePeriodEnd
NewTimeRecord.TimeBeginPicker.Date = datetimeTimePeriodBegin
NewTimeRecord.TimeEndPicker.Date = datetimeTimePeriodEnd

If NewTimeRecord.ShowModal() = mrOK Then

isoTimePeriodEnd = Utilities.DateToIso(NewTimeRecord.TimeEndPicker.Date)
isoTimePeriodBegin = objIniFile.WriteString(“Section”, “advTimePeriodBegin”, isoTimePeriodEnd)

End If

The bad news is that the form displays the time field from when the form was defined – not from datetimeTimePeriodBegin or datetimeTimePeriodEnd.