htlgh / jQuery-Date-List-Plugin

jQuery for creating day/month/year filtered lists, bound to a text field with the date value.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jQuery-Date-List-Plugin

jQuery plugin for creating day/month/year filtered lists, bound to a text field with the date value.

For an example visit the demo page

##Installation

<link rel="stylesheet" type="text/css" href="/css/jquery.dateLists.css">
<script type="text/javascript" src="/js/jquery.dateLists.min.js"></script>

##Basic Example

###HTML

<input type="text" id="test_fld" value="5-2-2000"/>

###Jquery

  <script type="text/javascript">  
   $().ready(function() {  
        $('#test_fld').dateDropDowns({dateFormat:'dd-mm-yy'});  
   });  
  </script>  

##Paramaters

  • dateFormat Determines the layout of the date, e.g., 'dd.mm.yy', 'mm/dd/yy', 'MM-DD-yy'. Defaults to 'dd-mm-yy'. Since mm and dd produce 1-digit values, use MM and DD for 2-digit values.
  • monthNames Array of month labels.
  • yearStart / yearEnd Integer value for start and end years. By default, yearStart is 1900 and yearEnd is current year.
  • defaultCurrentDate Boolean which defines if current date will be selected by default. If false then Jan 1, yearStart will be the initial value when the page is loaded. False by default.

###Jquery

  <script type="text/javascript">  
		$('#fld_id').dateDropDowns({
			dateFormat:'DD-mm-yy',
			monthNames: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
			yearStart:1950,
			yearEnd:new Date().getFullYear()-18, //allow registration only for adult users
			defaultCurrentDate:true
		}); 
  </script>  

Alan Donnelly

About

jQuery for creating day/month/year filtered lists, bound to a text field with the date value.

License:MIT License


Languages

Language:JavaScript 73.7%Language:HTML 23.1%Language:CSS 3.2%