Skip to content

Calendar WIP #1281

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 94 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
73a3d4e
Datepicker: Introduce value option
fnagel May 15, 2014
500ba8d
Calendar: Add calendar widget
fnagel Jun 3, 2014
3d52c37
Calendar: Add missing AMD dependency todo comment
fnagel Jun 4, 2014
4a6d820
Calendar: remove datepicker functionality, options and methods
fnagel Jun 3, 2014
b3831f2
Calendar: Fix focus highlighting when month is changed
fnagel Jun 3, 2014
cb13f3e
Calendar: Make use of uniqueId method
fnagel Jun 3, 2014
8bf93c2
Calendar: Add _isValid method
fnagel Jun 4, 2014
ac0fc77
Datepicker: $.date.selected() should return the actual date object
fnagel Jun 4, 2014
afd7e79
Datepicker: Remove calendar functionality, options and methods
fnagel Jun 4, 2014
b17e65a
Calendar: Add min and max option
fnagel Jun 4, 2014
5c715d1
Datepicker: Add min and max option
fnagel Jun 4, 2014
c05841d
Datepicker: Remove select callback reference
fnagel Jun 4, 2014
fdcc769
Calendar: Remove select callback reference
fnagel Jun 4, 2014
f011135
Calendar: Fix min / max option incl. refresh after setting option
fnagel Jun 4, 2014
5e934b3
Datepicker: Fix date range demo
fnagel Jun 4, 2014
91f549a
Datepicker: Remove unneeded inline demo file
fnagel Jun 4, 2014
cd45e92
Datepicker: Read and write min / max attributes
fnagel Jun 4, 2014
4b5f470
Datepicker tests: Add Calendar widget dependency to unit tests
fnagel Jun 4, 2014
a3e3341
Datepicker tests: Remove inline Datepicker unit tests
fnagel Jun 4, 2014
9b9efde
Datepicker: Simplify calendar generation
fnagel Jun 5, 2014
8f0a292
Calendar: Simplify calendar generation
fnagel Jun 5, 2014
93b9cb5
Datepicker: Code clean up for events
fnagel Jun 5, 2014
29a3093
Datepicker: Fix unit test
fnagel Jun 5, 2014
93ce02f
Datepicker: remove guard clause to check if element is an input
fnagel Jun 5, 2014
9b5627a
Datepicker: Remove unwanted keyboard shortcut
fnagel Jun 5, 2014
e49028c
Datepicker: Make sure calendar sets new option value before datepicker
fnagel Jun 5, 2014
e59b3c3
Datepicker: Make use of _getCreateOptions for min and max options
fnagel Jun 11, 2014
be74d36
Datepicker: Use correct format for reading min and max options.
fnagel Jun 11, 2014
15d25cd
Datepicker: Simplify usage of calendar options and avoid duplications
fnagel Jun 12, 2014
4768fa2
Datepicker: Fix input keyboard handling
fnagel Jun 12, 2014
54df099
Datepicker: Update value from input on refresh
fnagel Jun 12, 2014
0f29484
Datepicker: Simplify value method
fnagel Jun 12, 2014
e2b8a68
Datepicker: Fix dateFormat option setting incl. date-formats demo.
fnagel Jun 13, 2014
bcdc7d8
Datepicker tests: Adjust methods unit tests according to specs
fnagel Jun 13, 2014
44d9bc8
Datepicker: Fix some core unit tests, remove unneeded tests
fnagel Jun 13, 2014
6639253
Datepicker tests: Remove unneeded options unit tests, add todo comments
fnagel Jun 16, 2014
9ccf4b9
Datepicker tests: Rewrite unit test for beforeOpen event (#7602)
fnagel Jun 16, 2014
4581878
Datepicker tests: Re-enable some min / max option unit tests
fnagel Jun 16, 2014
16101b6
Datepicker tests: Adjust min / max option unit tests to specification
fnagel Jun 16, 2014
fe0d260
Datepicker tests: clean up method tests
fnagel Jun 16, 2014
c000222
Calendar: Add version property
fnagel Jun 16, 2014
be230db
Datepicker: Add version property
fnagel Jun 16, 2014
b9bbce4
Datepicker tests: Add common unit tests
fnagel Jun 16, 2014
0db381c
Datepicker tests: Add open and close unit tests
fnagel Jun 16, 2014
94e2ac5
Datepicker tests: Remove unneeded disabled / enabled options
fnagel Jun 16, 2014
b22a5bf
Datepicker tests: Rewrite setDate tests as valueAsDate method tests
fnagel Jun 17, 2014
9b06cc9
Calendar: Make it possible to set min / max option to null
fnagel Jun 17, 2014
d543741
Datepicker: Improve document click event
fnagel Jun 17, 2014
1d6c9fc
Calendar: Fix broken day table cell attributes
fnagel Jun 17, 2014
4129f7a
Datepicker tests: Rewrite event unit tests
fnagel Jun 17, 2014
3bf80f8
Datepicker tests: Code style improvements, add todo comment for ARIA
fnagel Jun 17, 2014
35922bc
Datepicker tests: Fix calendar keyboard control tests
fnagel Jun 17, 2014
9cf822f
Datepicker tests: Fix mouse core unit tests by adding delay
fnagel Jun 17, 2014
c73fa47
Datepicker tests: Code style
fnagel Jun 17, 2014
2cc6389
Datepicker tests: Unify show / hide options in helper create method
fnagel Jun 17, 2014
4cfbc5f
Datepicker: Fix alternate field demo
fnagel Jun 17, 2014
1f0f805
Datepicker: Fix demos after widget split
fnagel Jun 17, 2014
faddce6
Calendar: Fix multiple calendar styles (follow-up)
fnagel Jun 17, 2014
32f0998
Calendar: Fix German localization
fnagel Jun 17, 2014
b75b0f1
Datepicker: Sort and clean up demo index
fnagel Jun 17, 2014
ea2a102
Datepicker: Improve date formats demo
fnagel Jun 18, 2014
72be2c2
Datepicker: Fix localization demo
fnagel Jun 18, 2014
d252d9c
Datepicker tests: Fix method test messages
fnagel Jun 18, 2014
7368572
Datepicker: Several minor code improvements
fnagel Jun 18, 2014
747994f
Calendar: Fix hover event setting and removing
fnagel Jun 18, 2014
1745d90
Calendar: Improve code style and clean up
fnagel Jun 19, 2014
4dfcb79
Calendar: Focus class is not removed when using arrow keys
fnagel Jun 19, 2014
a5acd0f
Datepicker: Remove unwanted CTRL+HOME shortcut
fnagel Jun 19, 2014
2bf33f5
Datepicker: Rename multiple calendars demo to multiple months
fnagel Jun 19, 2014
2c9e7e2
Datepicker: Remove support for enter key on input
fnagel Jun 19, 2014
7c159a8
Datepicker: Improve localization handling, fix return indenting
fnagel Jun 19, 2014
17dc9fa
Calendar: Fix German localization
fnagel Jun 19, 2014
0f66ab8
Calendar: Update localization provided by Globalize on refresh
fnagel Jun 19, 2014
17b48e6
Datepicker tests: Add basic localization unit tests
fnagel Jun 19, 2014
e02bc85
Calendar: Improve comment
fnagel Jun 19, 2014
74acf65
Calendar: Rename multiple calendars demo to multiple months
fnagel Jun 19, 2014
0da34e2
Calendar: Sort and clean up demo index
fnagel Jun 19, 2014
7d8c8b4
Calendar: Fix demos after widget split
fnagel Jun 19, 2014
b952338
Calendar: Add buttons option
fnagel Jun 19, 2014
211c8a9
Datepicker: Add buttons option
fnagel Jun 19, 2014
6fdcaa3
Datepicker tests: Rework structure unit tests for buttons option
fnagel Jun 19, 2014
4973eea
Datepicker: Remove outdated localization tests
fnagel Jun 19, 2014
6cd5b1a
Calendar: Fix wrong class in _createButtons method
fnagel Jun 19, 2014
e087c57
Datepicker: Add option unit tests for buttons option
fnagel Jun 19, 2014
320cea0
Datepicker: Fix multiple calendar styles (follow-up)
fnagel Jun 19, 2014
7d3d764
Datepicker: Remove duplicate demos
fnagel Jun 19, 2014
d5b87f4
Calendar: Rename multiple calendars demo to multiple months (follow-up)
fnagel Jun 19, 2014
46e2a5e
Calendar tests: Rewrite core unit tests based on datepicker tests
fnagel Jun 20, 2014
8c43f02
Calendar tests: Add common unit tests
fnagel Jun 20, 2014
e484b9f
Calendar tests: Fix title
fnagel Jun 27, 2014
0c4e4c2
Calendar: Set selected property to null by default
fnagel Jul 1, 2014
8ac9041
Calendar tests: Rewrite method unit tests based on datepicker tests
fnagel Jul 1, 2014
6a2a598
Calendar: Adjust files to match reorganization of external directory
fnagel Jul 2, 2014
1e62cbf
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<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>
Expand All @@ -11,20 +11,24 @@
<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>
<script src="../../ui/datepicker.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>
10 changes: 5 additions & 5 deletions demos/datepicker/inline.html → demos/calendar/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Display inline</title>
<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>
Expand All @@ -11,21 +11,21 @@
<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>
<script src="../../ui/datepicker.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
$( "#calendar" ).calendar();
});
</script>
</head>
<body>

Date: <div id="datepicker"></div>
<div id="calendar"></div>

<div class="demo-description">
<p>Display the datepicker embedded in the page instead of in an overlay. Simply call .datepicker() on a div instead of an input.</p>
<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,7 +2,7 @@
<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>
Expand All @@ -11,12 +11,12 @@
<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>
<script src="../../ui/datepicker.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
$( "#calendar" ).calendar({
changeMonth: true,
changeYear: true
});
Expand All @@ -25,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>
17 changes: 12 additions & 5 deletions demos/datepicker/min-max.html → demos/calendar/min-max.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Restrict date range</title>
<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>
Expand All @@ -11,21 +11,28 @@
<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>
<script src="../../ui/datepicker.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({ minDate: -20, maxDate: "+1M +10D" });
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>

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

<div class="demo-description">
<p>Restrict the range of selectable dates with the <code>minDate</code> and <code>maxDate</code> options. Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)), as a numeric offset from today (-20), or as a string of periods and units ('+1M +10D'). For the last, use 'D' for days, 'W' for weeks, 'M' for months, or 'Y' for years.</p>
<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,7 +2,7 @@
<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>
Expand All @@ -11,12 +11,12 @@
<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>
<script src="../../ui/datepicker.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
$( "#calendar" ).calendar({
numberOfMonths: 3,
showButtonPanel: true
});
Expand All @@ -25,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>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Dates in other months</title>
<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>
Expand All @@ -11,12 +11,12 @@
<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>
<script src="../../ui/datepicker.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
$( "#calendar" ).calendar({
eachDay: function( day ) {
if ( day.lead ) {
day.render = true;
Expand All @@ -30,10 +30,10 @@
</head>
<body>

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

<div class="demo-description">
<p>The datepicker can show dates that come from other than the main month
<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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Show week of the year</title>
<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>
Expand All @@ -11,23 +11,23 @@
<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>
<script src="../../ui/datepicker.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#datepicker" ).datepicker({
$( "#calendar" ).calendar({
showWeek: true
});
});
</script>
</head>
<body>

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

<div class="demo-description">
<p>The datepicker can show the week of the year. The calculation follows
<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>
Expand Down
Loading