diff --git a/Gruntfile.js b/Gruntfile.js index b8610b6f641..3d9a11963db 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,6 +28,7 @@ var "core", "accordion", "autocomplete", + "calendar", "button", "datepicker", "dialog", diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index a147b8f573c..0d500ef09dd 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -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", diff --git a/demos/datepicker/buttonbar.html b/demos/calendar/buttonbar.html similarity index 57% rename from demos/datepicker/buttonbar.html rename to demos/calendar/buttonbar.html index 446bc9fe495..7ed390b25d1 100644 --- a/demos/datepicker/buttonbar.html +++ b/demos/calendar/buttonbar.html @@ -2,7 +2,7 @@
-Date:
+Display a button for selecting Today's date and a Done button for closing the calendar with the boolean showButtonPanel
option. Each button is enabled by default when the bar is displayed, but can be turned off with additional options. Button text is customizable.
Display a button for selecting Today's date with the buttons
option.
Display the datepicker embedded in the page instead of in an overlay. Simply call .datepicker() on a div instead of an input.
+The calendar is a widget for selecting a date using a visual calendar representation.
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.
+Date:
+Restrict the range of selectable dates with the minDate
and maxDate
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.
Restrict the range of selectable dates with the min
and max
options. Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)).
Set the numberOfMonths
option to an integer of 2 or more to show multiple months in a single calendar.
Select the date range to search for.
-diff --git a/demos/datepicker/localization.html b/demos/datepicker/localization.html index 61aa7c9a2da..01f90531eca 100644 --- a/demos/datepicker/localization.html +++ b/demos/datepicker/localization.html @@ -11,16 +11,21 @@ + diff --git a/demos/index.html b/demos/index.html index f37874a4481..c4a0fdf9501 100644 --- a/demos/index.html +++ b/demos/index.html @@ -11,6 +11,7 @@
+
diff --git a/external/date.js b/external/date.js index 06a67553205..8df3f63de92 100644 --- a/external/date.js +++ b/external/date.js @@ -26,9 +26,13 @@ $.date = function( date, globalFormat ) { if ( typeof date === "string" && date.length ) { this.dateObject = Globalize.parseDate( date, globalFormat ); } + if ( $.type( date ) === "date" ) { + this.dateObject = date; + } this.dateObject = this.dateObject || new Date(); this.globalFormat = globalFormat; + this.selected = null; }; $.date.prototype = { @@ -180,6 +184,9 @@ $.date.prototype = { this.selected = this.clone(); return this; }, + selectedDate: function() { + return this.selected.date(); + }, clone: function() { var date = this.dateObject; return new $.date( new Date( date.getFullYear(), date.getMonth(), diff --git a/external/localization.js b/external/localization.js index 98d8f813052..4fd436aca00 100644 --- a/external/localization.js +++ b/external/localization.js @@ -2767,10 +2767,10 @@ var regions = { "dateFormat": "d" }, "de": { - "closeText": "schlie\u00dfen", - "prevText": "<zur\u00fcck", + "closeText": "Schlie\u00dfen", + "prevText": "<Zur\u00fcck", "nextText": "Vor>", - "currentText": "heute", + "currentText": "Heute", "weekHeader": "Wo", "dateFormat": "d" }, diff --git a/tests/unit/all.html b/tests/unit/all.html index f8a4636d051..85e21077412 100644 --- a/tests/unit/all.html +++ b/tests/unit/all.html @@ -21,6 +21,7 @@ "button/button.html", "core/core.html", "core/core_deprecated.html", + "calendar/calendar.html", "datepicker/datepicker.html", "dialog/dialog.html", "draggable/draggable.html", diff --git a/tests/unit/calendar/all.html b/tests/unit/calendar/all.html new file mode 100644 index 00000000000..5b22b047024 --- /dev/null +++ b/tests/unit/calendar/all.html @@ -0,0 +1,26 @@ + + +
+ +
+ + + + + + + + + + + +
+