Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Outlook Time Picker

Reply
Thread Tools

Outlook Time Picker

 
 
scott
Guest
Posts: n/a
 
      05-26-2005
I'm trying to create a drop-down that populates choices with time increments
from 1:00 AM to 12:00 AM, just like Outlook displays. Below code does loop,
but I can not seem to get my hours to increment right or get AM and PM
correct. Any better way to accomplish this?

vLookupCalendarTimes= ""

Dim m,h,iHour,i
h=1
iHour = 1
r=1

For m = 1 to 48

r = m Mod 2

If m < 25 Then
sTimeAMPM = " AM"
Else
sTimeAMPM = " PM"
End If

If m = 1 Then
vLookupCalendarTimes = iHour & ":00:00" & sTimeAMPM
Else
Select Case r
Case r <> 0
vLookupCalendarTimes = vLookupCalendarTimes & "|" & "M" & m
& " - " & iHour & ":00:00" & sTimeAMPM
Case Else
vLookupCalendarTimes = vLookupCalendarTimes & "|" & "M" & m
& " - " & iHour & ":30:00" & sTimeAMPM
End Select
End If

m = m + 1
iHour = iHour + 1

Next

count = 0

xLookupCalendarTimes = Split(vLookupCalendarTimes, "|")

Response.Write "<select name=""StartTime"">"
Response.Write "<option selected>--Select Time--"

For Each x In xLookupCalendarTimes

Response.Write("<OPTION class=""FormTextBox"" value=""" &
xLookupCalendarTimes(count) & """>" & xLookupCalendarTimes(count) &
"</OPTION>")

count = count + 1
Next

Response.Write("</select>")


 
Reply With Quote
 
 
 
 
scott
Guest
Posts: n/a
 
      05-26-2005
I've got it going. I missed the obvious.


"scott" <> wrote in message
news:...
> I'm trying to create a drop-down that populates choices with time
> increments from 1:00 AM to 12:00 AM, just like Outlook displays. Below
> code does loop, but I can not seem to get my hours to increment right or
> get AM and PM correct. Any better way to accomplish this?
>
> vLookupCalendarTimes= ""
>
> Dim m,h,iHour,i
> h=1
> iHour = 1
> r=1
>
> For m = 1 to 48
>
> r = m Mod 2
>
> If m < 25 Then
> sTimeAMPM = " AM"
> Else
> sTimeAMPM = " PM"
> End If
>
> If m = 1 Then
> vLookupCalendarTimes = iHour & ":00:00" & sTimeAMPM
> Else
> Select Case r
> Case r <> 0
> vLookupCalendarTimes = vLookupCalendarTimes & "|" & "M" & m
> & " - " & iHour & ":00:00" & sTimeAMPM
> Case Else
> vLookupCalendarTimes = vLookupCalendarTimes & "|" & "M" & m
> & " - " & iHour & ":30:00" & sTimeAMPM
> End Select
> End If
>
> m = m + 1
> iHour = iHour + 1
>
> Next
>
> count = 0
>
> xLookupCalendarTimes = Split(vLookupCalendarTimes, "|")
>
> Response.Write "<select name=""StartTime"">"
> Response.Write "<option selected>--Select Time--"
>
> For Each x In xLookupCalendarTimes
>
> Response.Write("<OPTION class=""FormTextBox"" value=""" &
> xLookupCalendarTimes(count) & """>" & xLookupCalendarTimes(count) &
> "</OPTION>")
>
> count = count + 1
> Next
>
> Response.Write("</select>")
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date time picker for asp.net venky ASP .Net 2 04-13-2005 07:51 PM
Panels as pop-up windows (Date Time picker)... Blue Streak ASP .Net 1 03-21-2005 06:04 PM
Seeking *free* date time picker googlebart2000@yahoo.com Java 0 03-17-2005 11:40 PM
Date Time Picker Charles A. Lackman ASP .Net 4 11-30-2004 03:07 PM
JScript time picker Robert ASP .Net 1 07-07-2003 01:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57