Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
68f8e3c
Datepicker: Initial commit of widget rewrite work from old branch
tjvantoll Aug 26, 2013
5a78355
Datepicker: Remove delayed focus
scottgonzalez Jan 29, 2015
e50d6d3
Datepicker: Update tests and demos for new structure
tjvantoll Aug 30, 2013
9ec69cc
Datepicker: Fix the `eachDay` option
jzaefferer Sep 11, 2013
9bdb478
Datepicker: Only apply the `ui-state-focus` class name to one cell
tjvantoll Oct 30, 2013
8983fee
Datepicker: Clean up tests
tjvantoll Nov 2, 2013
b589390
Datepicker: Support changing the `appendTo` option after init
tjvantoll Nov 15, 2013
5fbe668
Datepicker: Various changes for the `showWeek` option
tjvantoll Nov 15, 2013
1a83120
Datepicker: Support `position` option changes after init
tjvantoll Nov 18, 2013
13cd6c2
Datepicker: Support changing `eachDay` after initialization
tjvantoll Nov 19, 2013
ab94999
Datepicker: Allow `dateFormat` to be changed after init
tjvantoll Nov 20, 2013
bfd8f26
Datepicker: Add test to ensure the `<input>`'s value is preselected
tjvantoll Nov 20, 2013
cc5a4bc
Datepicker: Support destroying inline datepickers
tjvantoll Nov 22, 2013
e87a5d8
Datepicker: Add `value()` and `valueAsDate()` methods
tjvantoll Nov 21, 2013
ff4bfd6
Datepicker: Fix key handling implementation and tests
tjvantoll Nov 22, 2013
ffc8ab2
Datepicker: Use Globalize 1.0.0
rxaviers Nov 30, 2013
605387d
Datepicker: Update key handling implementation and tests
tjvantoll Dec 27, 2013
104f3e6
Datepicker: Re-adding mouse tests
tjvantoll Jan 2, 2014
b4fe65a
Datepicker: Add an `isValid()` method
tjvantoll Jan 3, 2014
feedc57
Datepicker: Handle invalid values in `value()` and `valueAsDate()`
tjvantoll Jan 3, 2014
fd215f1
Datepicker: Update the picker as the user types valid dates
tjvantoll Jan 3, 2014
a9d6a65
Date: Update test suite to coding standards
tjvantoll Jan 9, 2014
77d7dd2
Date: Make `$.date()` a constructor function
tjvantoll Jan 9, 2014
cfea8df
Datepicker: Fix code style issues
fnagel Apr 23, 2014
f28b70e
Datepicker: Rename `select()` method to `_select()`
fnagel Apr 26, 2014
9c66d2e
Datepicker: Use `short` instead of `abbreviated` format for table header
fnagel Apr 26, 2014
ab2cb90
Datepicker: Properly define default for `dateFormat` option
fnagel Apr 26, 2014
6324828
Datepicker: Fix populate alternate field demo
fnagel Apr 26, 2014
a11e87c
Datepicker: Fix icon trigger demo
fnagel Apr 26, 2014
35b52a0
Datepicker: Introduce value option
fnagel May 15, 2014
510ba08
Calendar: Add calendar widget
fnagel Jun 3, 2014
f88a063
Calendar: Add min and max option.
fnagel Jun 4, 2014
6ef023f
Calendar: Remove select callback reference
fnagel Jun 4, 2014
5773640
Datepicker: Code clean up for events
fnagel Jun 5, 2014
63bdc3e
Datepicker: Remove unwanted keyboard shortcut
fnagel Jun 5, 2014
258a3ff
Datepicker: Simplify usage of calendar options and avoid duplications
fnagel Jun 12, 2014
6dfcd93
Datepicker tests: Add open and close unit tests
fnagel Jun 16, 2014
4302539
Datepicker: Improve document click event
fnagel Jun 17, 2014
90c704f
Calendar: Fix broken day table cell attributes
fnagel Jun 17, 2014
398ce1b
Datepicker tests: Rewrite event unit tests
fnagel Jun 17, 2014
35842c8
Calendar: Fix multiple calendar styles
fnagel Jun 17, 2014
fd3a68c
Calendar: Fix German localization
fnagel Jun 17, 2014
40e8519
Datepicker: Fix localization demo
fnagel Jun 18, 2014
b9d8f62
Datepicker: Several minor code improvements
fnagel Jun 18, 2014
2e2787d
Calendar: Fix hover event setting and removing
fnagel Jun 18, 2014
5df6d39
Datepicker: Improve localization handling, code style
fnagel Jun 19, 2014
9461f66
Calendar: Add buttons option
fnagel Jun 19, 2014
50f477f
Calendar: Adjust files to match reorganization of external directory
fnagel Jul 2, 2014
95fd20f
Datepicker tests: Remove pass-through options unit tests
fnagel Aug 29, 2014
e507477
Calendar: Use _on for link hover events
fnagel Aug 30, 2014
3289158
Datepicker: Add missing handling for disabled option
fnagel Sep 1, 2014
ee83c37
Calendar: Remove option method overwrite
fnagel Nov 7, 2014
43f66b8
Calendar: Make use of _setOptions to call refresh
fnagel Dec 18, 2014
9d423e5
Calendar: Sanitize active descendant id selector
fnagel Dec 28, 2014
33b1820
Calendar: Clean up demos.
fnagel Jan 18, 2015
cc91adf
Calendar: Use document.activeElement for retrieving focused element
fnagel Jan 19, 2015
91ff2ca
Datepicker: Run datepicker tests in Grunt qunit task
fnagel Jan 19, 2015
4778efc
Datepicker: Fix visual tests
fnagel Jan 20, 2015
c1b6891
Datepicker: Update description metadata
scottgonzalez Jan 29, 2015
2ea46ae
Calendar: Add build metadata
scottgonzalez Jan 29, 2015
876aed3
Datepicker: Make Calendar pass-through options more dynamic
fnagel Jan 20, 2015
a5734cd
Datepicker: Remove whitespace
fnagel Jan 20, 2015
11c1735
Calendar: Use button instead of link elements for day items
fnagel Jan 20, 2015
c29b5e4
Calendar: Fix border style for multiple months
fnagel Jan 20, 2015
d96ad14
Calendar: Clean up styles, add comments
fnagel Jan 30, 2015
bbe1eff
Calendar: Adjust styles to match theme changes
fnagel Jan 30, 2015
ec0d679
Calendar: Remove selected property from $.date
fnagel Jan 24, 2015
4c2229f
Calendar: Fix month jumping WIP
fnagel Jan 24, 2015
d9ee3a1
Calendar tests: Fix dateFormat option test
fnagel Mar 24, 2015
a3df6dd
Calendar: Add comment in _needsRefresh method
fnagel Apr 10, 2015
71d8f16
Merge branch 'master' into datepicker
scottgonzalez Jul 15, 2015
b5bae45
Spinner: Fix demos to use old Globalize
scottgonzalez Jul 15, 2015
d0a5a7a
Datepicker: Use Globalize 1.0.0
rxaviers Sep 3, 2014
b39bb72
Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
a16a788
Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
846852a
Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
9d552b7
Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
fda7a7e
Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
82ea79c
Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
b6d7436
(fix) Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
5d044dd
(fix) Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
7f432ed
(fix) Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
e56c2b4
(fix) Datepicker: Use Globalize 1.0.0
rxaviers Sep 4, 2014
e0acb2d
Datepicker: Use Globalize 1.0.0
fnagel Apr 25, 2015
8732ff7
Datepicker: Use Globalize 1.0.0
fnagel Apr 30, 2015
76c74e5
Datepicker: Use Globalize 1.0.0
fnagel Apr 30, 2015
8238c25
Merge branch 'datepicker' into datepicker-globalize-1.x
fnagel Apr 30, 2015
f9ba50d
Calendar: Update Globalize to 1.0.0
fnagel Jul 27, 2015
6db02da
Calendar: Re-introduce formatDate option
fnagel Jul 27, 2015
ce70446
Datepicker: Update to Globalize 1.0.0
fnagel Jul 28, 2015
8bd4030
Datepicker: Re-introduce formatDate option, simplify Globalize usage
fnagel Jul 28, 2015
31d9184
Merge branch 'master' into datepicker
scottgonzalez Aug 20, 2015
a307992
Calendar: Fix weekday name jumping when using numberOfMonths option
fnagel Aug 25, 2015
38101a4
Datepicker: Fix icon trigger demo
fnagel Aug 25, 2015
09be7b3
Calendar: Fix view when moving between multiple months with keyboard
fnagel Aug 25, 2015
c5b2d85
Calendar: Make use of escapeSelector method
fnagel Aug 25, 2015
483aecb
Calendar tests: Fix and clean-up $.ui.calendarDate unit tests
fnagel Aug 25, 2015
462f92f
Calendar tests: Fix wrong data-widget attribute
fnagel Aug 25, 2015
9bc5fd2
Calendar: Some code style and CGL fixes
fnagel Aug 25, 2015
31908a1
Calendar: Make header prev / next buttons min / max option aware
fnagel Aug 26, 2015
3135e5b
Calendar: Use day of the month instead day of the week for range
fnagel Aug 26, 2015
9c88ac9
Calendar tests: Fix min / max range header button state tests
fnagel Aug 26, 2015
430715b
Calendar: Use day of the month instead day of the week in setMonth
fnagel Aug 26, 2015
e6fe401
Datepicker: Use button instead of a link in icon trigger demo
fnagel Sep 2, 2015
558c31c
Calendar tests: Add header buttons test when using date below min option
fnagel Sep 2, 2015
521604e
Calendar tests: Test for using right arrow button with numberOfMonth
fnagel Sep 2, 2015
af7d200
Calendar: Remove some obsolete todo comments
fnagel Sep 10, 2015
dcef453
Calendar: Move custom date object to ui namespace
fnagel Sep 27, 2015
8a169db
Calendar: Remove all unused methods from custom date object
fnagel Sep 27, 2015
d650fa9
Calendar: Fix some jshint issues
fnagel Sep 27, 2015
3e14e0f
Calendar tests: Add comment to number of month test
fnagel Sep 27, 2015
66828b1
Calendar: Remove _refresh method
fnagel Sep 27, 2015
7e8b723
Merge branch 'master' into datepicker
fnagel Oct 7, 2015
2fe43bb
Calendar: Fix jscs errors after merging master
fnagel Oct 8, 2015
1566cf1
Calendar: Remove Globalize.cldr.supplemental.weekData dependency
fnagel Nov 16, 2015
c43149d
Calendar: Use globalize-runtime with compiled locales
fnagel Nov 18, 2015
9a879d0
Calendar: Fix first day of week calculation for non latin locales
fnagel Nov 18, 2015
d53f549
Datepicker: Fix outdated Globalize format option in date-format demo
fnagel Nov 18, 2015
9fdefee
Calendar: Remove unused data-modules attribute from localization demo
fnagel Nov 18, 2015
f646ba9
Date tests: Fix first day of week calculation for non latin locales
fnagel Nov 18, 2015
f2c9c9a
Calendar tests: Use globalize-runtime with compiled locales
fnagel Nov 18, 2015
705b674
Calendar tests: Add missing Gobalize formatter / parser full
fnagel Nov 18, 2015
7ed4554
Calendar: Fix jshint issues
fnagel Nov 25, 2015
c10ef0a
Merge branch 'master' into datepicker
fnagel Dec 2, 2015
5d3bdde
Calendar: Update Button widget implementation to latest changes
fnagel Dec 2, 2015
e63835c
Calendar tests: Fix and update button advances unit tests
fnagel Dec 2, 2015
8c10fce
Calendar: Fix header data
fnagel Dec 2, 2015
e0bbcb8
Calendar: Add css-dependency-comments based on jQuery Mobile
fnagel Dec 2, 2015
af97d08
Date: Improve header data
fnagel Dec 2, 2015
501c67e
Calendar: Fix focus issues
fnagel Dec 2, 2015
a68048f
Calendar: Fix ARIA ids for multiple months
fnagel Dec 2, 2015
1f92856
Calendar tests: Adjust structure tests to latest changes
fnagel Dec 3, 2015
1439205
Datepicker: Improve tab order handling
fnagel Dec 3, 2015
7ac903b
Calendar: Let datepicker handle focus after date selection
fnagel Dec 3, 2015
3cf5308
Calendar: Do not rebuild whole calendar when selecting date
fnagel Dec 3, 2015
e17e7b0
Calendar: Fix line indention
fnagel Dec 4, 2015
6baa74b
Date tests: Fix months method tests
fnagel Jan 20, 2016
b92f1b0
Merge branch 'master' into datepicker
fnagel Apr 12, 2016
3f74465
Calendar: Update globalize and cldr dependencies
fnagel Apr 12, 2016
280cda3
Datepicker: Always focus calendar grid when opening
fnagel Apr 13, 2016
f2bbea2
Calendar: Use shift and ctrl key as modifier for page up / down
fnagel Apr 13, 2016
e02ef66
Calendar: Add missing day cell and month label ARIA attributes
fnagel Apr 13, 2016
bd7a6f1
Calendar: Use classes option for non performance critical rendering
fnagel Apr 16, 2016
6fdf14f
Datepicker: Make use of classes option
fnagel Apr 16, 2016
d7939fa
Calendar: Add icons option support
fnagel Apr 16, 2016
ea6c475
Datepicker: Make use of Calendar widget icons option
fnagel Apr 16, 2016
d1152a3
Calendar tests: Add select event unit tests
fnagel May 22, 2016
967e581
Calendar: Make sure keydown original event is available
fnagel May 22, 2016
85fe553
Calendar tests: Add dateEqual assertion, clean up helper methods
fnagel May 22, 2016
2963622
Datepicker tests: Use setup and teardown methods, remove helper file
fnagel May 22, 2016
18ad526
Calendar tests: Use setup and teardown methods
fnagel May 22, 2016
877937e
Calendar tests: Add basic value option tests
fnagel May 22, 2016
ea986f2
Datepicker: Add missing Globalize parse format for min / max attribute
fnagel May 28, 2016
9428256
Datepicker: Add min / max option tests
fnagel May 29, 2016
6f9d266
Datepicker: Fix min / max attribute and add proper option parsing
fnagel May 29, 2016
9fc83a0
Calendar: Add change event
fnagel May 29, 2016
96b5a76
Calendar tests: Simplify timeout steps
fnagel Oct 11, 2016
890510c
Calendar tests: Use assert.expect instead of global expect
fnagel Oct 11, 2016
f64a7a4
Calendar: Use name space for timestamp data attribute
fnagel Oct 11, 2016
bd488f9
Calendar: Clear value if an invalid input was given
fnagel Oct 12, 2016
f010087
Calendar: Clear value if an invalid min / max option value was given
fnagel Oct 24, 2016
2c43879
Datepicker: Use simple split instead of globalize for parsing attributes
fnagel Oct 25, 2016
68028e7
Calendar tests: use dateEqual assert instead of timestamp compare
fnagel Oct 29, 2016
6b8ac7e
Merge branch 'master' into datepicker
fnagel Nov 9, 2016
042eae9
Datepicker: Set defaultElement to input, equivalent to Autocomplete
jzaefferer Nov 22, 2016
55b01ab
Date tests: Update to QUnit 2.x, shift to use no globals
fnagel Dec 11, 2016
c0f1bd6
Calendar tests: Update to QUnit 2.x, shift to use no globals
fnagel Dec 11, 2016
800307b
Datepicker tests: Update to QUnit 2.x, shift to use no globals
fnagel Dec 11, 2016
f001a4b
Calendar: Fix line length violations
fnagel Dec 11, 2016
b49d12d
Calendar: Use old globalize for spinner tests
fnagel Jan 18, 2017
de20614
Calendar: Make select and change event pass the current value
fnagel Dec 11, 2016
8b86430
Datepicker: Make select and change event pass the current value
fnagel Dec 11, 2016
767d173
Calendar: Introduce refresh callback event
fnagel Dec 11, 2016
00a470b
Calendar: Remove aria hidden on day cells
fnagel Dec 25, 2016
188550f
Calendar: Make sure option numberOfMonth could be changed after creation
fnagel Dec 11, 2016
4267e42
Merge branch 'master' into datepicker
fnagel Mar 30, 2017
a31bc8b
Date tests: Add basic timestamp tests
fnagel Mar 31, 2017
6d81c03
Date: Rename and improve timestamp and day getter and setter
fnagel Mar 31, 2017
27f9f87
Calendar tests: Remove unused and outdated daylight saving tests
fnagel Mar 31, 2017
b09c7e8
Calendar tests: Add basic ARIA attribute tests
fnagel Mar 31, 2017
7ef7f3a
Datepicker tests: Add ARIA tests
fnagel Mar 31, 2017
c1cb6e3
Calendar: Use widget extension to render year and month select
fnagel Apr 11, 2017
5ee64dd
Calendar: Introduce build methods for year and month title
fnagel Apr 12, 2017
9bb209c
Calendar: Introduce getter / setter for date and viewDate
fnagel Apr 12, 2017
d6de67a
Calendar: Introduce getter / setter for grid id
fnagel Apr 12, 2017
2b611ba
Calendar: Create helper methods for Date object creation
fnagel Apr 12, 2017
1b885ff
Merge branch 'master' into datepicker
fnagel Aug 26, 2017
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
52 changes: 51 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ grunt.initConfig({
findNestedDependencies: true,
skipModuleInsertion: true,
exclude: [ "jquery" ],
include: expandFiles( [ "ui/**/*.js", "!ui/core.js", "!ui/i18n/*" ] ),
include: expandFiles( [
"ui/**/*.js",
"!ui/widgets/calendar.js",
"!ui/widgets/datepicker.js",
"!ui/i18n/*"
] ),
out: "dist/jquery-ui.js",
wrap: {
start: createBanner( uiFiles ),
Expand Down Expand Up @@ -255,6 +260,16 @@ grunt.initConfig({
destPrefix: "external"
},
files: {
"cldrjs/cldr.js": "cldrjs/dist/cldr.js",
"cldrjs/cldr/event.js": "cldrjs/dist/cldr/event.js",
"cldrjs/cldr/supplemental.js": "cldrjs/dist/cldr/supplemental.js",
"cldrjs/LICENSE-MIT": "cldrjs/LICENSE-MIT",

"globalize/globalize-runtime.js": "globalize/dist/globalize-runtime.js",
"globalize/globalize-runtime/number.js": "globalize/dist/globalize-runtime/number.js",
"globalize/globalize-runtime/date.js": "globalize/dist/globalize-runtime/date.js",
"globalize/LICENSE.txt": "globalize/LICENSE.txt",

"qunit/qunit.js": "qunit/qunit/qunit.js",
"qunit/qunit.css": "qunit/qunit/qunit.css",
"qunit/LICENSE.txt": "qunit/LICENSE.txt",
Expand Down Expand Up @@ -464,6 +479,41 @@ grunt.registerTask( "update-authors", function() {
});
});

grunt.registerTask( "compile-globalize", function() {
var formatters,
Globalize = require( "globalize" ),
globalizeCompiler = require( "globalize-compiler" ),
cldrData = require( "cldr-data" ),
languages = [ "ar", "en", "de", "es", "zh" ];

Globalize.load( cldrData.entireMainFor.apply( this, languages ) );
Globalize.load( cldrData.entireSupplemental() );

formatters = languages.reduce( function( ret, language ) {
var globalize = new Globalize( language );

ret = ret.concat([
globalize.dateFormatter( { raw: "EEEEEE" } ),
globalize.dateFormatter( { raw: "EEEEE" } ),
globalize.dateFormatter( { raw: "EEEE" } ),
globalize.dateFormatter( { raw: "MMMM" } ),
globalize.dateFormatter( { raw: "w" } ),
globalize.dateFormatter( { raw: "c" } ),
globalize.dateFormatter( { date: "short" } ),
globalize.dateParser( { date: "short" } ),
globalize.dateFormatter( { date: "long" } ),
globalize.dateParser( { date: "long" } ),
globalize.dateFormatter( { date: "full" } ),
globalize.dateParser( { date: "full" } ),
globalize.numberParser()
]);

return ret;
}, [] );

grunt.file.write( "external/localization.js", globalizeCompiler.compile( formatters ) );
});

grunt.registerTask( "default", [ "lint", "requirejs", "test" ]);
grunt.registerTask( "jenkins", [ "default", "concat" ]);
grunt.registerTask( "lint", [ "asciilint", "jshint", "jscs", "csslint", "htmllint" ]);
Expand Down
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"qunit-assert-close": "JamesMGreene/qunit-assert-close#v1.1.1",
"qunit-composite": "JamesMGreene/qunit-composite#v1.1.0",
"requirejs": "2.1.14",
"globalize": "1.1.1",

"jquery-1.7.0": "jquery#1.7.0",
"jquery-1.7.1": "jquery#1.7.1",
Expand Down
1 change: 1 addition & 0 deletions build/tasks/testswarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var versions = {
"Accordion": "accordion/accordion.html",
"Autocomplete": "autocomplete/autocomplete.html",
"Button": "button/button.html",
"Calendar": "calendar/calendar.html",
"Checkboxradio": "checkboxradio/checkboxradio.html",
"Controlgroup": "controlgroup/controlgroup.html",
"Core": "core/core.html",
Expand Down
13 changes: 11 additions & 2 deletions demos/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var widgets = [
"accordion",
"autocomplete",
"button",
"calendar",
"checkboxradio",
"controlgroup",
"datepicker",
Expand Down Expand Up @@ -80,12 +81,20 @@ document.documentElement.className = "demo-loading";
require.config( {
baseUrl: window.location.pathname.indexOf( "demos/" ) !== -1 ? "../../ui" : "../../../ui",
paths: {
cldr: "../external/cldrjs/cldr",
"globalize-runtime": "../external/globalize/globalize-runtime",
"globalize-locales": "../external/localization",
jquery: "../external/jquery/jquery",
external: "../external/"
},
map: {
"*": {
"globalize": "globalize-runtime"
}
},
shim: {
"external/globalize/globalize.culture.de-DE": [ "external/globalize/globalize" ],
"external/globalize/globalize.culture.ja-JP": [ "external/globalize/globalize" ]
"external/globalize-old/globalize.culture.de-DE": [ "external/globalize-old/globalize" ],
"external/globalize-old/globalize.culture.ja-JP": [ "external/globalize-old/globalize" ]
}
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Display month &amp; year menus</title>
<title>jQuery UI Calendar - Display button bar</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<link rel="stylesheet" href="../demos.css">
<script src="../../external/requirejs/require.js"></script>
<script src="../bootstrap.js">
$( "#datepicker" ).datepicker({
changeMonth: true,
changeYear: 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>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>
<p>Display a button for selecting Today's date with the <code>buttons</code> option.</p>
</div>
</body>
</html>
8 changes: 4 additions & 4 deletions demos/datepicker/inline.html → demos/calendar/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Display inline</title>
<title>jQuery UI Calendar - Default functionality</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<link rel="stylesheet" href="../demos.css">
<script src="../../external/requirejs/require.js"></script>
<script src="../bootstrap.js">
$( "#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 a widget for selecting a date using a visual calendar representation.</p>
</div>
</body>
</html>
82 changes: 82 additions & 0 deletions demos/calendar/dropdown-month-year.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Calendar - Display month &amp; year menus</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<link rel="stylesheet" href="../demos.css">
<script src="../../external/requirejs/require.js"></script>
<script src="../bootstrap.js">
$.widget( "ui.calendar", $.ui.calendar, {
_buildTitleMonth: function() {
var select = $( "<select>" ),
date = this._getDate().clone(),
i = 0,
option;

this._on( select, {
change: function() {
this._off( select );
this._getDate().setFullDate(
this._getDate().year(),
select.val(),
this._getDate().day()
);
this._updateView();
}
} );

for ( ; i < 12; i++ ) {
date.setFullDate( select.val(), i, this._getDate().day() );
option = $( "<option>", { val: i, text: date.monthName() } );
if ( this._getDate().month() === i ) {
option.prop( "selected", true );
}
select.append( option );
}

return select;
},
_buildTitleYear: function() {
var current = new Date(),
select = $( "<select>" ),
i = current.getFullYear(),
option;

this._on( select, {
change: function() {
this._off( select );
this._getDate().setFullDate(
select.val(),
this._getDate().month(),
this._getDate().day()
);
this._updateView();
}
} );

for ( ;i <= current.getFullYear() + 10; i++ ) {
option = $( "<option>", { val: i, text: i } );
if ( this._getDate().year() === i ) {
option.prop( "selected", true );
}
select.append( option );
}

return select;
}
});

$( "#calendar" ).calendar();
</script>
</head>
<body>

<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.</p>
</div>
</body>
</html>
22 changes: 22 additions & 0 deletions demos/calendar/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!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="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">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Calendar - Localize calendar</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<link rel="stylesheet" href="../demos.css">
<script src="../../external/requirejs/require.js"></script>
<script src="../bootstrap.js">
var calendar = $( "#calendar" ),
select = $( "#locale" );

calendar.calendar({
locale: select.val()
});

select.change( function() {
calendar.calendar( "option", {
locale: select.val()
});
calendar.calendar( "valueAsDate", calendar.calendar( "valueAsDate" ) );
});
</script>
</head>
<body>

<div id="calendar"></div>
<select id="locale">
<option value="ar">Arabic</option>
<option value="de" selected>German</option>
<option value="en">English</option>
<option value="es">Spanish</option>
<option value="zh">Chinese Simplified</option>
</select>

<div class="demo-description">
<p>Localize the 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>
33 changes: 33 additions & 0 deletions demos/calendar/min-max.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!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">
<link rel="stylesheet" href="../demos.css">
<script src="../../external/requirejs/require.js"></script>
<script src="../bootstrap.js">
var now = new Date(),
dateMin = new Date( now.getFullYear(), now.getMonth(), now.getDate() + 1 ),
dateMax = new Date( now.getFullYear(), now.getMonth(), now.getDate() + 8 );

dateMin = new Date( 2008, 2 - 1, 29 );
dateMax = new Date( 2008, 12 - 1, 7 );


$( "#calendar" ).calendar({
min: dateMin,
max: dateMax,
value: new Date( 2008, 1 - 1, 4 )
});
</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 (<code>new Date(2009, 1 - 1, 26)</code>).</p>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Datepicker - Display multiple months</title>
<title>jQuery UI Calendar - Display multiple months</title>
<link rel="stylesheet" href="../../themes/base/all.css">
<link rel="stylesheet" href="../demos.css">
<script src="../../external/requirejs/require.js"></script>
<script src="../bootstrap.js">
$( "#datepicker" ).datepicker({
numberOfMonths: 3,
showButtonPanel: true
$( "#calendar" ).calendar({
numberOfMonths: 3
});
</script>
</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>
Loading