Skip to content

Datepicker and Calendar: WIP #1260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 177 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
d3216b3
Datepicker: Initial commit of widget rewrite work from old branch. Hi…
tjvantoll Aug 26, 2013
b850573
Datepicker: Get datepicker's test suite to at least run. It fails hor…
tjvantoll Aug 30, 2013
bf19f75
Datepicker: Updating/fixing the animation demo.
tjvantoll Aug 30, 2013
632aa2b
Datepicker: Fix the build. Exclude broken datepicker units from runni…
jzaefferer Sep 11, 2013
7a8f351
Datepicker: Fix dateFormat demo by adding a dateFormat option and pas…
jzaefferer Sep 11, 2013
c8217f5
Datepicker: Update all demos to include necessary dependencies. Doesn…
jzaefferer Sep 11, 2013
f0b49f6
Datepicker: Improve animations demo, make slideUp actually work
jzaefferer Sep 11, 2013
907d370
Datepicker: Fix localization demo
jzaefferer Sep 11, 2013
abaeedc
Datepicker: Update alt-field demo - remove the options and use Global…
jzaefferer Sep 11, 2013
cb3f565
Datepicker: Fix dependencies on buttonbar demo
jzaefferer Sep 11, 2013
7adf5bf
Datepicker: Fix the eachDay option (until we have a better design), u…
jzaefferer Sep 11, 2013
88d3c69
Datepicker: Update icon-trigger demo, build a custom trigger. Prevent…
jzaefferer Sep 11, 2013
b59d4de
Datepicker: Only apply the ui-state-focus class name to one cell.
tjvantoll Oct 30, 2013
45d64ea
Datepicker: Fixing widget() method test and minor coding standard cha…
tjvantoll Nov 2, 2013
41add14
Datepicker: Updating first batch of structure tests to new APIs and s…
tjvantoll Nov 2, 2013
ebeb23e
Datepicker: Fixing and/or commenting out remaning multi month datepic…
tjvantoll Nov 2, 2013
5baa227
Datepicker: Fixing or commenting out remaining structure tests.
tjvantoll Nov 3, 2013
c8a0eed
Datepicker: Cleaning up and commenting out custom structure tests as …
tjvantoll Nov 3, 2013
00debdf
Datepicker: Coding standards and new APIs for keyboard handling tests.
tjvantoll Nov 4, 2013
fb79842
Datepicker: Coding standards and new APIs for mouse core tests.
tjvantoll Nov 4, 2013
f79cc9e
Datepicker: Commenting out event tests with TODOs for now.
tjvantoll Nov 5, 2013
97ad9ca
Datepicker: Adding boilerplate for events in new API.
tjvantoll Nov 6, 2013
45c126d
Datepicker: Updating tests for the destroy() method.
tjvantoll Nov 6, 2013
c68d3e5
Datepicker: Updating enable()/disable() tests.
tjvantoll Nov 6, 2013
6782140
Datepicker: Boilerplate for other method tests.
tjvantoll Nov 6, 2013
0f6d4e2
Datepicker: Commenting out the options tests for now as they are almo…
tjvantoll Nov 13, 2013
b986309
Merge branch 'master' into datepicker
tjvantoll Nov 15, 2013
d32a482
Datepicker: Saner id attribute values for the test suite.
tjvantoll Nov 15, 2013
1074fdd
Datepicker: Support changing the appendTo option after init.
tjvantoll Nov 15, 2013
601bf92
Datepicker: Boilerplate for tests for additional implemented options.
tjvantoll Nov 15, 2013
488665a
Datepicker: Various changes for the showWeek option.
tjvantoll Nov 15, 2013
25ac260
Datepicker: Support position option changes after init. Added positio…
tjvantoll Nov 18, 2013
6da407b
Datepicker: Position tests should create a new <input>.
tjvantoll Nov 19, 2013
6e36670
Datepicker: Support changing eachDay after initialization. Add tests …
tjvantoll Nov 19, 2013
dfad85f
Datepicker: Allow dateFormat to be changed after init. Add dateFormat…
tjvantoll Nov 20, 2013
f83adf8
Datepicker: Adding test to ensure the <input>'s value is preselected …
tjvantoll Nov 20, 2013
83646f9
Datepicker: Implementing a value() method.
tjvantoll Nov 21, 2013
b668db2
Datepicker: Implement a valueAsDate() method.
tjvantoll Nov 21, 2013
560e704
Datepicker: Support destroying inline datepickers.
tjvantoll Nov 22, 2013
44eb843
Datepicker: Add tests for the value() and valueAsDate() methods and i…
tjvantoll Nov 22, 2013
3333c70
Datepicker: Remove unnecessary code now that destroying inline picker…
tjvantoll Nov 22, 2013
fd94740
Datepicker: Enter keypresses on the <input> should select the current…
tjvantoll Nov 22, 2013
a089c49
Datepicker: Enable enter with existing value test. Coding standards c…
tjvantoll Nov 22, 2013
845814c
Datepicker: Restore handling of Control+Home and Control+End on the <…
tjvantoll Nov 22, 2013
e14f8e6
Datepicker: Updating escape key tests to new APIs.
tjvantoll Nov 25, 2013
fdaac17
Datepicker: First batch of tests for arrow key handling.
tjvantoll Nov 25, 2013
febd2b2
Datepicker: Use Globalize 1.0.0
rxaviers Nov 30, 2013
db78dd5
Datepicker: Use Globalize 1.0.0
rxaviers Dec 2, 2013
e4a3e82
Datepicker: Test for up and down arrow keys
tjvantoll Dec 27, 2013
677601c
Datepicker: Tests for Page Up and Page Down keys
tjvantoll Dec 27, 2013
7e79a71
Datepicker: Tests for moving years with Page Up and Page Down
tjvantoll Dec 27, 2013
6c2a806
Datepicker: Use explicit dates in tests.
tjvantoll Jan 2, 2014
0c40d2a
Datepicker: Port tests for keyboard handling with short months & leap…
tjvantoll Jan 2, 2014
010a131
Datepicker: Re-adding mouse tests.
tjvantoll Jan 2, 2014
5da4880
Datepicker: Adding an isValid() method.
tjvantoll Jan 3, 2014
b2018c4
Datepicker: Handle for invalid values in value() and valueAsDate()
tjvantoll Jan 3, 2014
98c8556
Datepicker: Update the picker as the user types valid dates
tjvantoll Jan 3, 2014
0cd4989
Date: Updating test suite to coding standards.
tjvantoll Jan 9, 2014
dee3879
Date: Make $.date() a constructor function. Move methods to prototype.
tjvantoll Jan 9, 2014
8b2e13c
Merge branch 'master' into datepicker
tjvantoll Feb 20, 2014
e86cd81
Merge branch 'master' into datepicker
fnagel Apr 16, 2014
4d65dae
Datepicker: fix jshint and htmllint issues, code style
fnagel Apr 23, 2014
036190e
Datepicker: rename select method to _select
fnagel Apr 26, 2014
6ee2cd5
Datepicker: fix and simplify icon trigger demo
fnagel Apr 26, 2014
7175e0d
Datepicker: use short instead of abbreviated format for table header
fnagel Apr 26, 2014
2914766
Datepicker: remove unneeded comma
fnagel Apr 26, 2014
c3a2b1b
Datepicker: remove unneeded default setting of option dateFormat
fnagel Apr 26, 2014
3736808
Datepicker: fix populate alternate field demo
fnagel Apr 26, 2014
8d9f5db
Datepicker: adjust date.js day name unit test to short name change
fnagel Apr 26, 2014
cd96b4c
Datepicker: restore old icon trigger demo behavior
fnagel Apr 28, 2014
49728a9
Datepicker: Introduce value option
fnagel May 15, 2014
d6c8e5d
Calendar: Add calendar widget
fnagel Jun 3, 2014
bb275b7
Calendar: remove unneeded translation files
fnagel Jun 3, 2014
44baada
Calendar: Rename $.date selected method
fnagel Jun 3, 2014
d11e35b
Calendar: remove datepicker functionality, options and methods
fnagel Jun 3, 2014
7aac60a
Calendar: Fix focus highlighting when month is changed
fnagel Jun 3, 2014
485825d
Calendar: Make use of uniqueId method
fnagel Jun 3, 2014
dad7a63
Calendar: Add _isValid method
fnagel Jun 4, 2014
9191785
Datepicker: $.date.selected() should return the actual date object
fnagel Jun 4, 2014
8acfca5
Datepicker: Remove calendar functionality, options and methods
fnagel Jun 4, 2014
aa1aea1
Calendar: Fix AMD dependencies
fnagel Jun 4, 2014
504ab73
Calendar: Add min and max option
fnagel Jun 4, 2014
ada1afb
Calendar: Remove unneeded demo files
fnagel Jun 4, 2014
8f5e4c8
Datepicker: Add min and max option
fnagel Jun 4, 2014
83ff362
Datepicker: Remove select callback reference
fnagel Jun 4, 2014
088bcca
Calendar: Remove select callback reference
fnagel Jun 4, 2014
c1e4beb
Calendar: Fix min / max option incl. refresh after setting option
fnagel Jun 4, 2014
9709140
Calendar: Fix multiple calendar styles
fnagel Jun 4, 2014
2d380e8
Datepicker: Fix date range demo
fnagel Jun 4, 2014
8feabf1
Datepicker: Remove unneeded inline demo file
fnagel Jun 4, 2014
6083a01
Datepicker: Read and write min / max attributes
fnagel Jun 4, 2014
7cabbef
Calendar: Add missing AMD dependency todo comment
fnagel Jun 4, 2014
43b448e
Datepicker: Read and write min / max attributes (follow-up)
fnagel Jun 4, 2014
fb774c8
Datepicker tests: Add Calendar widget dependency to unit tests
fnagel Jun 4, 2014
21c101d
Datepicker tests: Remove inline Datepicker unit tests
fnagel Jun 4, 2014
87acbb6
Datepicker: Simplify calendar generation
fnagel Jun 5, 2014
706b4fe
Calendar: Simplify calendar generation
fnagel Jun 5, 2014
e593e15
Datepicker: Code clean up for events
fnagel Jun 5, 2014
56d662e
Datepicker: Fix uni test
fnagel Jun 5, 2014
f703b9b
Datepicker: remove guard clause to check if element is an input
fnagel Jun 5, 2014
936f88b
Datepicker: Remove unwanted keyboard shortcut
fnagel Jun 5, 2014
f339e25
Datepicker: remove unneeded translation files
fnagel Jun 5, 2014
ae3594d
Datepicker: Make sure calendar sets new option value before datepicker
fnagel Jun 5, 2014
c9e0b7b
Datepicker: Make use of _getCreateOptions for min and max options
fnagel Jun 11, 2014
4122838
Datepicker: Use correct format for reading min and max options.
fnagel Jun 11, 2014
f37357f
Datepicker: Simplify usage of calendar options and avoid duplications
fnagel Jun 12, 2014
5a6b6ff
Datepicker: Fix input keyboard handling
fnagel Jun 12, 2014
6a50410
Datepicker: Update value from input on refresh
fnagel Jun 12, 2014
4a0cdde
Datepicker: Simplify value method
fnagel Jun 12, 2014
7bf578b
Datepicker: Fix dateFormat option setting incl. date-formats demo.
fnagel Jun 13, 2014
42e8950
Datepicker tests: Adjust methods unit tests according to specs
fnagel Jun 13, 2014
26a4ed6
Datepicker: Fix some core unit tests, remove unneeded tests
fnagel Jun 13, 2014
f375c7d
Datepicker tests: Remove unneeded options unit tests, add todo comments
fnagel Jun 16, 2014
9e26110
Merge branch 'master' into datepicker
fnagel Jun 16, 2014
3c2917e
Datepicker tests: Rewrite unit test for beforeOpen event (#7602)
fnagel Jun 16, 2014
c4ff049
Datepicker tests: Re-enable some min / max option unit tests
fnagel Jun 16, 2014
1131bce
Datepicker tests: Adjust min / max option unit tests to specification
fnagel Jun 16, 2014
66ba886
Datepicker tests: clean up method tests
fnagel Jun 16, 2014
0d3cd04
Calendar: Add version property
fnagel Jun 16, 2014
8531690
Datepicker: Add version property
fnagel Jun 16, 2014
f338f59
Datepicker tests: Add common unit tests
fnagel Jun 16, 2014
f00e733
Datepicker: code style
fnagel Jun 16, 2014
fe57299
Calendar: code style
fnagel Jun 16, 2014
dcbac00
Datepicker tests: Add open and close unit tests
fnagel Jun 16, 2014
95a33b5
Datepicker tests: Remove unneeded disabled / enabled options
fnagel Jun 16, 2014
3daa9a7
Datepicker tests: Rewrite setDate tests as valueAsDate method tests
fnagel Jun 17, 2014
8cf0e8f
Calendar: Make it possible to set min / max option to null
fnagel Jun 17, 2014
a8189d9
Datepicker: Improve document click event
fnagel Jun 17, 2014
91dfe6e
Calendar: Fix broken day table cell attributes
fnagel Jun 17, 2014
2aacbb9
Datepicker tests: Rewrite event unit tests
fnagel Jun 17, 2014
8bf7263
Datepicker tests: Code style improvements, add todo comment for ARIA
fnagel Jun 17, 2014
32eb9ac
Datepicker tests: Fix calendar keyboard control tests
fnagel Jun 17, 2014
550a0a1
Datepicker tests: Fix mouse core unit tests by adding delay
fnagel Jun 17, 2014
b9278de
Datepicker tests: Code style
fnagel Jun 17, 2014
f187eb5
Datepicker tests: Unify show / hide options in helper create method
fnagel Jun 17, 2014
9672361
Datepicker: Fix alternate field demo
fnagel Jun 17, 2014
0c3d2f2
Datepicker: Fix demos after widget split
fnagel Jun 17, 2014
557dfbe
Calendar: Fix multiple calendar styles (follow-up)
fnagel Jun 17, 2014
0b8ad82
Calendar: Fix German localization
fnagel Jun 17, 2014
becc812
Datepicker: Sort and clean up demo index
fnagel Jun 17, 2014
a4ca299
Datepicker: Improve date formats demo
fnagel Jun 18, 2014
200bfe8
Datepicker: Fix localization demo
fnagel Jun 18, 2014
b4d522d
Datepicker tests: Fix method test messages
fnagel Jun 18, 2014
ba11bf8
Datepicker: Several minor code improvements
fnagel Jun 18, 2014
138fd3a
Calendar: Fix hover event setting and removing
fnagel Jun 18, 2014
181b1de
Calendar: Improve code style and clean up
fnagel Jun 19, 2014
732424b
Calendar: Focus class is not removed when using arrow keys
fnagel Jun 19, 2014
ac0f9da
Datepicker: Remove unwanted CTRL+HOME shortcut
fnagel Jun 19, 2014
c0d9e8e
Datepicker: Rename multiple calendars demo to multiple months
fnagel Jun 19, 2014
f498918
Datepicker: Remove support for enter key on input
fnagel Jun 19, 2014
772703e
Datepicker: Improve localization handling, fix return indenting
fnagel Jun 19, 2014
5513e14
Calendar: Fix German localization
fnagel Jun 19, 2014
0c6a529
Calendar: Update localization provided by Globalize on refresh
fnagel Jun 19, 2014
0819e58
Datepicker tests: Add basic localization unit tests
fnagel Jun 19, 2014
2b8c4d8
Calendar: Improve comment
fnagel Jun 19, 2014
a07e9f9
Calendar: Rename multiple calendars demo to multiple months
fnagel Jun 19, 2014
c63073f
Calendar: Sort and clean up demo index
fnagel Jun 19, 2014
66385d4
Calendar: Fix demos after widget split
fnagel Jun 19, 2014
4110db0
Calendar: Add buttons option
fnagel Jun 19, 2014
22e29af
Datepicker: Add buttons option
fnagel Jun 19, 2014
422f798
Datepicker tests: Rework structure unit tests for buttons option
fnagel Jun 19, 2014
764305c
Datepicker: Remove outdated localization tests
fnagel Jun 19, 2014
fd88d79
Calendar: Fix wrong class in _createButtons method
fnagel Jun 19, 2014
546565b
Datepicker: Add option unit tests for buttons option
fnagel Jun 19, 2014
37377a5
Datepicker: Fix multiple calendar styles (follow-up)
fnagel Jun 19, 2014
86ca70b
Datepicker: Remove duplicate demos
fnagel Jun 19, 2014
ef3a30c
Calendar: Rename multiple calendars demo to multiple months (follow-up)
fnagel Jun 19, 2014
b547f3a
Calendar: Remove unneeded image
fnagel Jun 19, 2014
632adc6
Calendar tests: Rewrite core unit tests based on datepicker tests
fnagel Jun 20, 2014
c9fdefe
Calendar tests: Add common unit tests
fnagel Jun 20, 2014
923a4b8
Calendar tests: Remove unneeded image
fnagel Jun 20, 2014
98517b3
Calendar tests: Fix title
fnagel Jun 27, 2014
9e8936d
Calendar: Set selected property to null by default
fnagel Jul 1, 2014
2051a8d
Calendar tests: Rewrite method unit tests based on datepicker tests
fnagel Jul 1, 2014
4ce0c3f
Merge branch 'master' into datepicker
fnagel Jul 2, 2014
077e9aa
Calendar: Adjust files to match reorganization of external directory
fnagel Jul 2, 2014
7bb5056
Datepicker: Adjust files to match reorganization of external directory
fnagel Jul 2, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var
"core",
"accordion",
"autocomplete",
"calendar",
"button",
"datepicker",
"dialog",
Expand Down
1 change: 1 addition & 0 deletions build/tasks/testswarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var versions = {
"Accordion": "accordion/accordion.html",
"Autocomplete": "autocomplete/autocomplete.html",
"Button": "button/button.html",
"Calendar": "calendar/calendar.html",
"Core": "core/core.html",
"Core_deprecated": "core/core_deprecated.html",
"Datepicker": "datepicker/datepicker.html",
Expand Down
19 changes: 14 additions & 5 deletions demos/datepicker/buttonbar.html → demos/calendar/buttonbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,33 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Display button bar</title>
<title>jQuery UI Calendar - Display button bar</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/datepicker.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
showButtonPanel: true
$( "#calendar" ).calendar({
buttons: {
"Today": function() {
$( this ).calendar( "valueAsDate", new Date() );
}
}
});
});
</script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>
<div id="calendar"></div>

<div class="demo-description">
<p>Display a button for selecting Today's date and a Done button for closing the calendar with the boolean <code>showButtonPanel</code> option. Each button is enabled by default when the bar is displayed, but can be turned off with additional options. Button text is customizable.</p>
Expand Down
52 changes: 52 additions & 0 deletions demos/calendar/date-formats.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Calendar - Format date</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
var calendar = $( "#calendar" ).calendar(),
value;

$( "#format" ).change(function() {
value = $( this ).val();
switch( value ) {
case "iso":
calendar.calendar( "option", "dateFormat", { pattern: "yyyy-MM-dd" } );
break;
default:
calendar.calendar( "option", "dateFormat", { date: value } );
break;
}
});
});
</script>
</head>
<body>

<div id="calendar"></div>

<p>Format options:<br />
<select id="format">
<option value="short">Short - M/d/yy in "en" locale</option>
<option value="long">Long - MMMM d, y in "en" locale</option>
<option value="iso">ISO 8601 - yyyy-MM-dd</option>
</select>
</p>

<div class="demo-description">
<p>Display date feedback in a variety of ways. Choose a date format from the dropdown, then click on the input and select a date to see it in that format.</p>
</div>
</body>
</html>
31 changes: 31 additions & 0 deletions demos/calendar/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Calendar - Default functionality</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#calendar" ).calendar();
});
</script>
</head>
<body>

<div id="calendar"></div>

<div class="demo-description">
<p>The calendar is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Display month &amp; year menus</title>
<title>jQuery UI Calendar - Display month &amp; year menus</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/datepicker.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
$( "#calendar" ).calendar({
changeMonth: true,
changeYear: true
});
Expand All @@ -20,7 +25,7 @@
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>
<div id="calendar"></div>

<div class="demo-description">
<p>Show month and year dropdowns in place of the static month/year header to facilitate navigation through large timeframes. Add the boolean <code>changeMonth</code> and <code>changeYear</code> options.</p>
Expand Down
23 changes: 23 additions & 0 deletions demos/calendar/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Calendar Demos</title>
</head>
<body>

<ul>
<li><a href="default.html">Default functionality</a></li>
<li><a href="buttonbar.html">Display button bar</a></li>
<li><a href="date-formats.html">Format date</a></li>
<li><a href="dropdown-month-year.html">Display month &amp; year menus</a></li>
<li><a href="localization.html">Localize calendar</a></li>
<li><a href="min-max.html">Restrict date range</a></li>
<li><a href="multiple-months.html">Display multiple months</a></li>
<li><a href="other-months.html">Dates in other months</a></li>
<li><a href="show-week.html">Show week of the year</a></li>
</ul>

</body>
</html>
41 changes: 41 additions & 0 deletions demos/calendar/localization.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Calendar - Localize calendar</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
var calendar = $( "#calendar" ).calendar(),
date = calendar.calendar( "valueAsDate" );

$( "#locale" ).change(function() {
Globalize.locale( $(this).val() );
calendar.calendar( "valueAsDate", date );
});
});
</script>
</head>
<body>

<div id="calendar"></div>
<select id="locale">
<option value="de-DE" selected>German (Deutsch)</option>
<option value="en">English</option>
</select></p>

<div class="demo-description">
<p>Localize the calendar calendar language and format (English / Western formatting is the default). The calendar includes built-in support for languages that read right-to-left, such as Arabic and Hebrew.</p>
</div>
</body>
</html>
38 changes: 38 additions & 0 deletions demos/calendar/min-max.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Calendar - Restrict date range</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
var now = new Date(),
dateMin = new Date( now.getFullYear(), now.getMonth(), now.getDay() + 1 ),
dateMax = new Date( now.getFullYear(), now.getMonth(), now.getDay() + 8 );

$( "#calendar" ).calendar({
min: dateMin,
max: dateMax
});
});
</script>
</head>
<body>

<div id="calendar"></div>

<div class="demo-description">
<p>Restrict the range of selectable dates with the <code>min</code> and <code>max</code> options. Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)).</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Display multiple months</title>
<title>jQuery UI Calendar - Display multiple months</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/datepicker.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
$( "#calendar" ).calendar({
numberOfMonths: 3,
showButtonPanel: true
});
Expand All @@ -20,10 +25,10 @@
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>
<div id="calendar"></div>

<div class="demo-description">
<p>Set the <code>numberOfMonths</code> option to an integer of 2 or more to show multiple months in a single datepicker.</p>
<p>Set the <code>numberOfMonths</code> option to an integer of 2 or more to show multiple months in a single calendar.</p>
</div>
</body>
</html>
40 changes: 40 additions & 0 deletions demos/calendar/other-months.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Calendar - Dates in other months</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#calendar" ).calendar({
eachDay: function( day ) {
if ( day.lead ) {
day.render = true;
day.selectable = true;
day.extraClasses = "ui-priority-secondary";
}
}
});
});
</script>
</head>
<body>

<div id="calendar"></div>

<div class="demo-description">
<p>The calendar can show dates that come from other than the main month
being displayed. These other dates can also be made selectable.</p>
</div>
</body>
</html>
35 changes: 35 additions & 0 deletions demos/calendar/show-week.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Calendar - Show week of the year</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../../external/globalize/globalize.js"></script>
<script src="../../external/date.js"></script>
<script src="../../external/localization.js"></script>
<script src="../../ui/core.js"></script>
<script src="../../ui/widget.js"></script>
<script src="../../ui/button.js"></script>
<script src="../../ui/calendar.js"></script>
<script src="../../ui/position.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#calendar" ).calendar({
showWeek: true
});
});
</script>
</head>
<body>

<div id="calendar"></div>

<div class="demo-description">
<p>The calendar can show the week of the year. The calculation follows
<a href="http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table">Unicode CLDR specification</a>.
This means that some days from one year may be placed into weeks 'belonging' to another year.</p>
</div>
</body>
</html>
Loading