javascript - using the time as a dynamic variable to compare values -


I am working on a paging programming in JS which captures calendar data from an external source, it has a multi-dimensional array In import and use it is currently working with your photo, phone number etc., to display.

I have set it up so that the page reloads every 15 minutes. I want to do all this in a dynamic way so that when the clock starts at 5 o'clock, the page knows to update without wait until it refreshes for 15 minutes.

All work expired in 24 hours format from other calendars (that is 5:00 1700).

Here's how I am currently making the current time to compare with the beginning / end of the calendar:

  // Current date and time received Date dateTime = new date (); Var month = dateTime.getMonth () + 1; Var day = dateTime.getDate (); Var dayOfWeek = dateTime.getDay (); Var year = datetime.gatevair () + 1900; // Strings to change the hours and minutes as the time of 24 hours; date = datetime.gethors (). ToString (); If (hours.labhi === 1) {var hour = '0' + hour}; Var min = datetime.getwind (). ToString (); If (minutes.lumby === 1) {var minute = '0' minute}; Var time = hours + minute; Convert a number to // 24h time later to read from Var time num = parseInt (time);  

I use when periodically to compare start / end time with imported schedules to determine who is currently working and push that array. Which is finally displayed on the page code:

  // Find out who is currently working and putting them into work now Sir var varingNow = []; To convert time strings to (i = 0; i & lt; workingToday.length; i ++) {// var startTime = parseInt (working [i] [7]); Var endime = parseint (working [i] [8]); // Compare the start and end time with current time and add those people if they are working in the new list (if the start time & lt; time number & amp; amp; amp; amp; amp; # 39; time; & lt; endtime) {workNow.push (Working [i]); }};  

I think I'm trying to explain how to dynamically compare data with current time in an array. Is it possible or will I have to go totally different from the ground about this?

You should keep track of Pulses. It's a great library to handle manipulation of all types of time and date.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

c# - NewtonSoft JArray - how to select multiple elements with LINQ -

javascript - amcharts makechart not working -