Set year of datepicker using jquery

Mahavirsinh Padhiyar

I am doing some work in .net technology using MVC 4.0 with VB language.

I have dropdownlist that has a set of years from 2006 to running year. I want to set the selected year from dropdownlist to datepicker so I can have that year specific months and days and I have done following changes in datepicker.

 $('input').filter('.datepickerHoliday').datepicker({
                            changeMonth: true,
                            changeYear: false,
                            showYear: false,
                            dateFormat: 'mm/dd/' + yr,
                        });

How can I do this?

Vinod

This might do the trick. This is an basic you can build top of it.

var myDate = new Date();
var prettyDate = 01 + '/' + 01 + '/' + 'your selected dropdownlist year'
$("#date_pretty").val(prettyDate);

here is an link which gives you what you need :

Link

Link

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

TOP Ranking

HotTag

Archive