javascript - Date picker highlights after refresh -


I have a jquery ui datepicker that highlights the week when I select a date. But because I am changing the url space (finally to fit a parameter) and refresh the page and whatever I clicked and highlighted is lost, I want to be able to click on a date and when If that page is refreshed, then that week has been highlighted. The week which needs to be highlighted can be taken from the URL so that after highlighting it can be highlighted and highlighted so that I need help.

This code is:

  $ (function () {var startDate; var endDate; var selectCurrentWeek = function () {window.setTimeout (function () {$ ( Find the '' Week-picker ''. ('.ui-datepicker-current-day a') AddClass ('ui-state-active')}, 1);} function check (D) {if (d.length ) == 2) {dd = d; return dd;} else {dd = "0" + MyDateParts [0]; return dd;}} var selectedWeek; // Remember what week user has here $ ('week- Picker '). Datepicker ({before before ShowDay: $ .datepicker.noWeekends, showOtherMonths: true, selectOtherMonths: true, on selection: function (date text, installation) {var date = $ (this) .datepicker (' getDate '); Start date = new date (date.getFullYear), date.getMonth (), date.getDate () - wire B GetDay () + 1); endDate = new Date (date.getFullYear), date.getMonth (), date.getDate () - date.getDay () + 6); Var dateFormat = 'yy-mm-dd' var NewDate = $ ('# startDate') .text ($. Datepicker.formatDate (dateFormat, startDate, inst.settings)); Var old data = document.getElementById ('start'); Var date_textnode = old date First child; Var date_text = date_textnode.data; MyDateParts = date_text.split ("-"); Var dd = myDateParts [2]; Var mm = myDateParts [1]; Var yy = myDateParts [0]; SelectCurrentWeek (); Window.location.href = "/ tileheet? Week_commoning =" + ya + "-" + mm + "-" + dd; }, First show: function (date) {var cssClass = ''; If (date> = startDate & date & lt; = endDate) cssClass = 'ui-datepicker-current-day'; Return [true, cssClass]; }, OnChangeMonthier: Function (Year, Month, Inst.) {SelectCurrentWeek (); }}); $ ('Week-picker .ui-datepicker-calendar tr'). Live ('mousemove', function () {$ (this) .find ('td a'). AddClass ('ui-state-hover');}); $ ('Week-picker .ui-datepicker-calendar tr'). Live ('mouseleave', function () {$ (this) .find ('td a'). RemoveClass ('ui-state-hover');}); });   

Thanks in advance

insert in the selected week URL, then when the page is reloaded, remove the parameter from the URL and accordingly load the date picker.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -