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

#7913
Support 3
Participant

Based on the code above, when the Form displayed first there was not date saved to the INI file.
isoTimePeriodBegin = objIniFile.ReadString(“Section”, “advTimePeriodBegin”, “”)

I think after the first execution the date value stored to the INI file so the subsequent execution you should see the correct date value.

Basically, isoTimePeriodEnd will be empty for the very first execution. You can add some defensive code so the isoTimePeriodEnd may be refer to the a date. Example:

  
if (len(isoTimePeriodEnd) = 0) then
  isoTimePeriodEnd = Utilities.DateToIso(Date-1)
end if

Note, make sure you are saving the INI file to disk.

Regards,
Advansys Support