Tuesday 15 May 2012

Week slider jquery , getting date of days form previous/following week/. -


I want to create a schedule schedule slider with jQuery.

When the user clicks on the left arrow then he should load the previous week's dates (starts from Monday), when the right arrow next week etc. Is going to happen.

And here my code is so far:

/ * to fill the day calendar * / var curr = new date; // Get the current date var first = curr.getDate () - curr.getDay () + 1; // The first day is the day of the month - the last day of the week = first + 6; // Last day is the first day + 6 var first day = new date (curr.setDate (first)); Var Last Day = New Date (curr.setDate (Last)); Var daysTD = $ ('day-tr. Td'); Var actual date = new date (date.parse (first day)); Var i = 0; DaysTD.each (function () {var day = new date (curr.setDate (first + i)); $ (this) .text (day.format ('d m')); i ++;}); Var schedule lat = $ ('schedule-NE schedulle-left-arrow'); Var scheduleRight = $ ('schedule- nav .schedule-right-arrow'); ScheduleRight.click (function () {}); ScheduleLeft.click (function () {});

I use to format date output.

Let me do the schedulum raid.click (function ()) and schedule lift.click (function () what should be kept ?? Any ideas?

I have got the solution. I used to write it. Here is the code:

/ * filling the date Calendar for * / var daysTD = $ ('day-tr TD'); var workoutsTD = $ ('. Workout-tr td') real actual = moment (); var monthText = $ ('month-text') ; Var schedulerre = []; (I .each (function () {var dzien = mondayDate.day (i); $ (this) .text (dzien.format ('ddd d MMMM ')); i ++;}); i = 1; to identify the columns later in the functions of the array. (Function () {var dzien = tmpdate.day (i); $ (this). Attr ("data-day", dzien.format ('L')); i ++;});} schedule ERight.click (function () {actualvack = moment (actual wiki) .add (6, 'd' ); FillTheDates (actualWeek);}); ScheduleLeft.click (function () (Previous Wiic = moment (actual vik); Previous vyak = Previous vaic softtrack (6, 'day'); Actual vik = moment (previous vik); Filling ones (previous wake);});

No comments:

Post a Comment