diff --git a/Gruntfile.js b/Gruntfile.js index 1aac2c45435..dbd5441d638 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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 ), @@ -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", @@ -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" ]); diff --git a/bower.json b/bower.json index 1af4b8eadee..77fa8ac482a 100644 --- a/bower.json +++ b/bower.json @@ -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", diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index b7f8d33bff3..0b35f7f2a93 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -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", diff --git a/demos/bootstrap.js b/demos/bootstrap.js index 9a82071c797..0a109ef9e55 100644 --- a/demos/bootstrap.js +++ b/demos/bootstrap.js @@ -30,6 +30,7 @@ var widgets = [ "accordion", "autocomplete", "button", + "calendar", "checkboxradio", "controlgroup", "datepicker", @@ -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" ] } } ); diff --git a/demos/datepicker/dropdown-month-year.html b/demos/calendar/buttonbar.html similarity index 50% rename from demos/datepicker/dropdown-month-year.html rename to demos/calendar/buttonbar.html index ab3da5d0af3..28ee693cc31 100644 --- a/demos/datepicker/dropdown-month-year.html +++ b/demos/calendar/buttonbar.html @@ -3,23 +3,26 @@
-Date:
+Show month and year dropdowns in place of the static month/year header to facilitate navigation through large timeframes. Add the boolean changeMonth
and changeYear
options.
Display a button for selecting Today's date with the buttons
option.