?
Solved

asp work schedule and javascript calendar

Posted on 2004-11-09
5
Medium Priority
?
320 Views
Last Modified: 2012-05-05
i have a javascript calendar when i click the button
the calendar pops up and when i select the date, it will insert into
textbox.

i also have one textbox for the TIME , and this is my question:

when i click the calendar ,the date will insert into textbox,
also the TIME will automatically display to textbox and this TIME is
taken from DB, it's an asp script that will retrieve the work
schedule of the user.


in other words:

if the user chooses,
 ex. nov.8, 2004, this is monday, asp script will call the work schedule of the user. if the work schedule of the user for monday is 5:48PM, the time 5:48PM will display into textbox..


is this possible?


thanks in advance...
0
Comment
Question by:wawee
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
nurbek earned 440 total points
ID: 12542336
try

<%
DBTime= Now() 'get the time from database

%>
<script>
   var LocalTime = new Date();
     
   LocalTime = TimeSetting(LocalTime ,<%=Day(DBTime)%>,<%=Month(DBTime)%>,<%=Year(DBTime)%>,<%=Hour(DBTime)%>,<%=Minute(DBTime)%>,<%=Second(DBTime)%>);

function TimeSetting(myDate,mDay,mMonth,mYear,mHour,mMinute,mSecond) {  
   myDate.setDate(mDay);
   myDate.setMonth(mMonth);
   myDate.setYear(mYear);
   myDate.setHours(mHour);
   myDate.setMinutes(mMinute);
   myDate.setSeconds(mSecond);
   return myDate;
}

document.all.myField.value = LocalTime;
</script>

0
 

Author Comment

by:wawee
ID: 12552132
how can i test this?
0
 
LVL 13

Expert Comment

by:nurbek
ID: 12552586
change the server time

<%
DBTime= DateAdd("n",-60,Now()) ' exctract 60 minutes
'DBTime= DateAdd("n",60,Now()) ' add 60 minutes

%>
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question