Current location: Hot Scripts Forums » Programming Languages » ASP » converting php date picker to asp


converting php date picker to asp

Reply
  #1 (permalink)  
Old 05-23-04, 10:17 PM
AshleyQuick AshleyQuick is offline
Newbie Coder
 
Join Date: May 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
converting php date picker to asp

Would someone be willing to convert this to asp?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 05-24-04, 07:26 AM
chirag's Avatar
chirag chirag is offline
Newbie Coder
 
Join Date: May 2004
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Cool

Hi there,

I don't know why you wanted someone to do this but here is the asp version of your php code.

Take this...
Save following code as .asp you need to do nothing else just run in your web server....

<%

dateDropDown 90,"DropDate"

function DayName (intDay)
select case intDay
case 1
DayName = "Sun"
break
case 2
DayName = "Mon"

case 3
DayName = "Tue"

case 4
DayName = "Wed"

case 5
DayName = "Thu"

case 6
DayName = "Fri"

case 7
DayName = "Sat"

end select
end function


function DateDropDown(size,default1)
'// $size = the number of days to display in the drop down
'// $default1 = Todays date in m:d:Y format (SEE DATE COMMAND ON WWW.PHP.NET)
'// $skip = if set then the program will skip Sundays and Saturdays
skip=1
response.write "size=" & size
response.write "<select name=" & default1 & " STYLE=\font-family: monospace;><br>"
'response.write "size=" & size
for i = 0 to cint(size)
'theday = mktime (0,0,0,date("m") ,date("d")+$i ,date("Y"))
'$option=date("D M j, Y",$theday)
option1= dayname(weekday(date+1)) & " " & left(monthname(month(date+1)),3) & " " & day(date+1) & " , " & year(date+1)
value=month(date+1)& "-" & day(date+1) & "-" & year(date+1)
'$dow=date("D",$theday)
dow=weekday(date+1)
''''response.write "<br><br><br><br><br><br>dow=" & dow
''response.end
if dow=vbSunday then
response.write "<option disabled>&nbsp;</option><br>"
end if
if (value = default1) then
selected="SELECTED"
else
selected=""
end if
if ((dow<>vbsunday and dow<>vbsaturday) or not skip) then
response.write "<option value=" & value & selected & ">" & option1 & "</option><br>"
end if
next
response.write "</select><br>"
end function
%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 05-24-04, 08:58 AM
AshleyQuick AshleyQuick is offline
Newbie Coder
 
Join Date: May 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Doesn't seem to be working. Beside the select box, the script is writing size=90 and the options in the select box are all showing tomorrow's date.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 05-25-04, 12:52 AM
chirag's Avatar
chirag chirag is offline
Newbie Coder
 
Join Date: May 2004
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
You are right...Sorry for mistake
take this....

<%

dateDropDown 90,"DropDate"

function DayName (intDay)
select case intDay
case 1
DayName = "Sun"

case 2
DayName = "Mon"

case 3
DayName = "Tue"

case 4
DayName = "Wed"

case 5
DayName = "Thu"

case 6
DayName = "Fri"

case 7
DayName = "Sat"

end select
end function


function DateDropDown(size,default1)
'// $size = the number of days to display in the drop down
'// $default1 = Todays date in m:d:Y format (SEE DATE COMMAND ON WWW.PHP.NET)
'// $skip = if set then the program will skip Sundays and Saturdays
skip=1
'''response.write "size=" & size
response.write "<select name=" & default1 & " STYLE=\font-family: monospace;><br>"
'response.write "size=" & size
for i = 0 to cint(size)
'theday = mktime (0,0,0,date("m") ,date("d")+$i ,date("Y"))
'$option=date("D M j, Y",$theday)
option1= dayname(weekday(date+i)) & " " & left(monthname(month(date+i)),3) & " " & day(date+i) & " , " & year(date+i)
value=month(date+i)& "-" & day(date+i) & "-" & year(date+i)
'$dow=date("D",$theday)
dow=weekday(date+i)
''''response.write "<br><br><br><br><br><br>dow=" & dow
''response.end
if dow=vbSunday then
response.write "<option disabled>&nbsp;</option><br>"
end if
if (value = default1) then
selected="SELECTED"
else
selected=""
end if
if ((dow<>vbsunday and dow<>vbsaturday) or not skip) then
response.write "<option value=" & value & selected & ">" & option1 & "</option><br>"
end if
next
response.write "</select><br>"
end function
%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
converting date error darkcarnival PHP 6 03-22-04 03:49 PM
Converting mySQL datetime into something readable (with PHP) bitesize PHP 0 10-27-03 02:22 AM
Converting My/SQL 'DATETIME' to PHP... giropets PHP 1 10-20-03 09:09 PM
Converting to PHP darkcarnival PHP 0 08-03-03 12:03 PM
converting CGI/Perl site to PHP lordmerlin PHP 7 08-03-03 07:01 AM


All times are GMT -5. The time now is 07:03 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.