Thursday, 15 August 2013

javascript - jquery ui datepicker go to today button -



javascript - jquery ui datepicker go to today button -

i need calendar go current date when [today] button clicked, user can current day when browsing calendar.

for illustration current month feb 2013 , user browsing on dec 2015 page of calendar when clicks [today] button automatically homecoming current days page of calendar feb 2013.

i'am using

jquery-ui-datepicker.min.js

as plugin calendar

you do:

function todaysdate() { var currenttime = new date() var month = currenttime.getmonth() + 1 var day = currenttime.getdate() var year = currenttime.getfullyear() homecoming month + "/" + day + "/" + year; } $("#btntoday").click(function() { var today = new date(); $(target).datepicker('setdate', todaysdate()); }

where target date picker command id.

javascript jquery jquery-ui calendar datepicker

No comments:

Post a Comment