javascript - Jquery DatePicker YearRange based on current month -


"itemprop =" text ">

I'm using datepicker for jQuery and I want to know if this yearRange change properties based on current month Is possible for

In my case, if the month is different from November or December yearRange its current year

otherwise this current year + 1

example is 1 :

on average in April

  .datepicker ({showOn: "buttons", buttonImageOnly: true, changeMonth: true, changeYear: true , YearRange: '-12: +0':  

Example 2:

Current month: November

  .datepicker ({showOn: "buttons", buttonImage: "../../App_Themes/Samae/images/calendar.png", buttonImageOnly: true, changeMonth: true, changeYear: true, yearRange: '-12: +1'  

Thanks!

< Str Ong> jQuery code

  $ (function () {var d = new date (); var month = d.getMonth (); var category ; If (month == 10 || months == 11) {range = '-12: +1';} and {class = '-12: +0';} $ ('# txtDate'). Datepicker ({ ChangeMonth: true, changeYear: true, yearreange: range}); });  

You can work by changing the status and changing it to if (month == 03 || month == 11) .

Optional

  $ (function () {var d = new date (); var month = d .getMonth (); $ ('# txtDate') datepicker ({changeMonth: true., ChangeYear: true, yearRange: (months == 10 || months == 11) '-12: +1': ' -12: +0 '});});  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -