Kevin Smith
asked on
Force a specific time in this vCalendar code...?
I use the vcalendar code to send an appointment from a webform. How do I use the code below to always have the time set to 8:00:00 am? So if a user only puts in a date, the code will make sure the appointment is set to 8am.
' Get the start and end dates of the event (GMT).
startDateAdd = request.form("startdate")
endDate = request.form("startdate")
' Get a unique ID to assign to the calendar event.
uniqueID = FormatDateTime(Now()) & "-" & tmpName & "-@" &_
Request.ServerVariables("S ERVER_NAME ")
Set file = fso.CreateTextFile(filenam e)
' Write the iCalendar file to the file system.
file.WriteLine "BEGIN:VCALENDAR"
file.WriteLine "PRODID:-//ASP iCalendar Test//My ASP App V1.0//EN"
file.WriteLine "VERSION:2.0"
file.WriteLine "METHOD:REQUEST"
file.WriteLine "BEGIN:VEVENT"
file.WriteLine "ORGANIZER:MAILTO:" & Session("MM_Username")
file.WriteLine "DTSTART:" & FormatDateTime(startDateAd d)
file.WriteLine "DTEND:" & FormatDateTime(endDate)
file.WriteLine "LOCATION:MSS"
file.WriteLine "TRANSP:OPAQUE"
file.WriteLine "SEQUENCE:0"
file.WriteLine "UID:" & uniqueID
file.WriteLine "DESCRIPTION:New Hire Start Date."
file.WriteLine "SUMMARY:New Hire Start Date"
file.WriteLine "PRIORITY:5"
file.WriteLine "CLASS:PUBLIC"
file.WriteLine "BEGIN:VALARM"
file.WriteLine "TRIGGER:-PT15M"
file.WriteLine "ACTION:DISPLAY"
file.WriteLine "END:VALARM"
file.WriteLine "END:VEVENT"
file.WriteLine "END:VCALENDAR"
' Get the start and end dates of the event (GMT).
startDateAdd = request.form("startdate")
endDate = request.form("startdate")
' Get a unique ID to assign to the calendar event.
uniqueID = FormatDateTime(Now()) & "-" & tmpName & "-@" &_
Request.ServerVariables("S
Set file = fso.CreateTextFile(filenam
' Write the iCalendar file to the file system.
file.WriteLine "BEGIN:VCALENDAR"
file.WriteLine "PRODID:-//ASP iCalendar Test//My ASP App V1.0//EN"
file.WriteLine "VERSION:2.0"
file.WriteLine "METHOD:REQUEST"
file.WriteLine "BEGIN:VEVENT"
file.WriteLine "ORGANIZER:MAILTO:" & Session("MM_Username")
file.WriteLine "DTSTART:" & FormatDateTime(startDateAd
file.WriteLine "DTEND:" & FormatDateTime(endDate)
file.WriteLine "LOCATION:MSS"
file.WriteLine "TRANSP:OPAQUE"
file.WriteLine "SEQUENCE:0"
file.WriteLine "UID:" & uniqueID
file.WriteLine "DESCRIPTION:New Hire Start Date."
file.WriteLine "SUMMARY:New Hire Start Date"
file.WriteLine "PRIORITY:5"
file.WriteLine "CLASS:PUBLIC"
file.WriteLine "BEGIN:VALARM"
file.WriteLine "TRIGGER:-PT15M"
file.WriteLine "ACTION:DISPLAY"
file.WriteLine "END:VALARM"
file.WriteLine "END:VEVENT"
file.WriteLine "END:VCALENDAR"
What date format does the calendar return?
ASKER
mm/mdd/yyyy hh:mm:ss and am/pm. It defaults the time to 12am.
So you click on a date and time and if you don't choose a time it returns date + 12:00:00 AM?
"So if a user only puts in a date, the code will make sure the appointment is set to 8am"
How are they entering the time?
How are they entering the time?
ASKER
I have a javascript date picker, but they also enter it manually. All the js does it enter it into the startDateAdd field.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
where would I put that?