jQuery: The Write Less, Do More JavaScript Library

UI/Datepicker

From jQuery JavaScript Library

Jump to: navigation, search

« Back to the jQuery UI Docs

UI Datepicker v3.4 Documentation

Very comprehensive documentation from the creators: [1]

Documentation for legacy versions: v3.3, v3.2, history

NameType
Plugin methods:



NameType
datepicker( options ) Returns: jQuery
The method that you use to create a new date picker. Customize with plenty of options.
datepicker( "change", settings ) Returns: jQuery
Change the settings for a previously attached datepicker.
datepicker( "dialog", dateText, onSelectsettings ) Returns: jQuery
Open a datepicker in a "dialog" box.
datepicker( "disable" ) Returns: jQuery
Disable an input field and its attached date picker.
datepicker( "enable" ) Returns: jQuery
Enable an input field and its attached date picker.
datepicker( "isDisabled" ) Returns: boolean
Determine whether a date picker has been disabled.
datepicker( "hide", speed ) Returns: jQuery
Close a previously opened date picker.
datepicker( "show" ) Returns: jQuery
Call up a previously attached date picker.
datepicker( "destroy" ) Returns: jQuery
Disconnect the datepicker functionality from its associated control.
datepicker( "getDate" ) Returns: Date or Date[2]
Retrieve the current date(s) for a datepicker.
datepicker( "setDate", date, endDate ) Returns: jQuery
Set the current date(s) for a datepicker.
Example:
A simple jQuery UI Datepicker. Just add a text input field to your page and then attach the datepicker to it.

$('#example').datepicker();
$('#exampleRange').datepicker({rangeSelect: true, firstDay: 1});

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  
  <script>
  $(document).ready(function(){
    $('#example').datepicker();
$('#exampleRange').datepicker({rangeSelect: true, firstDay: 1});
  });
  </script>
  
</head>
<body>
  <link rel="stylesheet" href="http://dev.jquery.com/view/trunk/themes/flora/flora.datepicker.css" type="text/css" media="screen" title="Flora (Default)">
<script  src="http://dev.jquery.com/view/trunk/ui/datepicker/core/ui.datepicker.js"></script>
<input type="text" id="example" value="Click inside me to see a datepicker" style="width:300px;"/>
<input type="text" id="exampleRange" value="Range datepicker starting on Monday." style="width:300px;"/>
</body>
</html>

NameType
Utilities:














NameType
$.datepicker.setDefaults( settings ) Returns: Datepicker
Change the default settings for all date pickers
$.datepicker.formatDate( format, date, settings ) Returns: String
Format a date into a string value with a specified format.
$.datepicker.iso8601Week( date ) Returns: Number
Determine the week of the year for a given date: 1 to 53.
$.datepicker.parseDate( format, value, settings ) Returns: Date
Extract a date from a string value with a specified format.
Localization:

NameType
Theming:

NameType
Changelog:

NameType
Authors:

NameType