Skip to content

Commit 48c4730

Browse files
committed
Add files option for npm, fix docs, fix indents on tests
1 parent e23e2b4 commit 48c4730

30 files changed

+341
-324
lines changed

.gitignore

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
docs/_build
2-
node_modules/
32
*-dist.zip
4-
bower_components/
3+
4+
# OS or Editor folders
5+
.DS_Store
6+
.idea
7+
8+
# Folders to ignore
9+
bower_components
10+
node_modules

.npmignore

-1
This file was deleted.

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sudo: false
33
language: node_js
44

55
node_js:
6-
- "0.10"
7-
6+
- "5"
7+
88
before_script:
99
- npm install -g grunt-cli

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The issue tracker is not the place for support requests. If you get stuck with
88

99
If you've found a bug in bootstrap-datepicker, we want to know about it! However, please keep the following in mind:
1010

11-
* This is not the bootstrap-datepicker from [eyecon.ro](http://www.eyecon.ro/bootstrap-datepicker/). Stefan provided the initial code for bootstrap-datepicker, but this repo is divergent from his codebase. Please make sure you're using either the latest tagged version or the latest master from https://github.com/eternicode/bootstrap-datepicker/ .
11+
* This is not the bootstrap-datepicker from [eyecon.ro](http://www.eyecon.ro/bootstrap-datepicker/). Stefan provided the initial code for bootstrap-datepicker, but this repo is divergent from his codebase. Please make sure you're using either the latest tagged version or the latest master from https://github.com/eternicode/bootstrap-datepicker/.
1212
* A working example of the bug you've found is *much* easier to work with than a description alone. If possible, please provide a link to a demonstration of the bug, perhaps using http://jsfiddle.net/ .
1313
* CDN-backed assets can be found at http://bsdp-assets.blackcherry.us/ . These should be used *only* for building test cases, as they may be removed or changed at any time.
1414
* Finally, it's possible someone else has already reported the same bug you have. Please search the issue tracker for similar issues before posting your own. Thanks!
@@ -21,7 +21,7 @@ For all cases, you should have your own fork of the repo.
2121

2222
To submit a pull request for a **new feature**:
2323

24-
1. Run the tests. Every pull request for a new feature should have an accompanying unit test and docs changes. See the README in the `tests/` and `docs/` directories for details.
24+
1. Run the tests. Every pull request for a new feature should have an accompanying unit test and docs changes. See the `README.md` in the `tests/` and `docs/` directories for details.
2525
2. Create a new branch off of the `master` branch for your feature. This is particularly helpful when you want to submit multiple pull requests.
2626
3. Add a test (or multiple tests) for your feature. Again, see `tests/README.md`.
2727
4. Add your new feature, making the test pass.

Gruntfile.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function(grunt){
1616
' * Improvements by Andrew Rowls',
1717
' * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)',
1818
' */'
19-
].join('\n'),
19+
].join('\n') + '\n',
2020

2121
// Task configuration.
2222
clean: {
@@ -59,7 +59,6 @@ module.exports = function(grunt){
5959
},
6060
concat: {
6161
options: {
62-
banner: '<%= banner %>',
6362
stripBanners: true
6463
},
6564
main: {
@@ -125,7 +124,8 @@ module.exports = function(grunt){
125124
options: {
126125
banner: '<%= banner %>'
127126
},
128-
css: 'dist/css/*.css'
127+
css: 'dist/css/*.css',
128+
js: 'dist/js/**/*.js'
129129
},
130130
cssmin: {
131131
options: {
@@ -207,11 +207,11 @@ module.exports = function(grunt){
207207
require('time-grunt')(grunt);
208208

209209
// JS distribution task.
210-
grunt.registerTask('dist-js', ['concat', 'uglify:main', 'uglify:locales']);
210+
grunt.registerTask('dist-js', ['concat', 'uglify:main', 'uglify:locales', 'usebanner:js']);
211211

212212
// CSS distribution task.
213213
grunt.registerTask('less-compile', 'less');
214-
grunt.registerTask('dist-css', ['less-compile', 'cssmin:main', 'cssmin:standalone', 'usebanner']);
214+
grunt.registerTask('dist-css', ['less-compile', 'cssmin:main', 'cssmin:standalone', 'usebanner:css']);
215215

216216
// Full distribution task.
217217
grunt.registerTask('dist', ['clean:dist', 'dist-js', 'dist-css']);

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ Versions are incremented according to [semver](http://semver.org/).
1111

1212
## CDN
1313

14-
You can use the [CloudFlare](https://www.cloudflare.com) powered [cdnjs.com](https://cdnjs.com) on your website.
14+
You can use the [CloudFlare](https://www.cloudflare.com) powered [cdnjs.com](https://cdnjs.com) on your website.
1515

1616
[bootstrap-datepicker](http://cdnjs.com/libraries/bootstrap-datepicker) on cdnjs
1717

1818
Please note: It might take a few days until a new version is available on cdnjs.
1919

2020
## Links
2121

22-
* [Online Demo](http://eternicode.github.io/bootstrap-datepicker/)
23-
* [Online Docs](http://bootstrap-datepicker.readthedocs.org/en/stable/) (ReadTheDocs.com)
22+
* [Online Demo](https://eternicode.github.io/bootstrap-datepicker/)
23+
* [Online Docs](https://bootstrap-datepicker.readthedocs.org/en/stable/) (ReadTheDocs.com)
2424
* [Google Group](https://groups.google.com/group/bootstrap-datepicker/)
2525
* [Travis CI ![Build Status](https://travis-ci.org/eternicode/bootstrap-datepicker.svg?branch=master)](https://travis-ci.org/eternicode/bootstrap-datepicker)
2626

2727
## Development
2828

2929
Once you cloned the repo, you'll need to install [grunt](http://gruntjs.com/) and the development dependencies using [npm](https://www.npmjs.com/).
3030

31-
npm install -g grunt-cli
32-
npm install
31+
$ [sudo] npm install -g grunt-cli
32+
$ npm install

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bootstrap-datepicker",
33
"main": [
44
"dist/css/bootstrap-datepicker3.css",
5-
"dist/js/bootstrap-datepicker.min.js"
5+
"dist/js/bootstrap-datepicker.js"
66
],
77
"license": "Apache-2.0",
88
"dependencies": {

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
# General information about the project.
5656
project = u'bootstrap-datepicker'
57-
copyright = u'2013, eternicode'
57+
copyright = u'2016, eternicode'
5858

5959
# The language for content autogenerated by Sphinx. Refer to documentation
6060
# for a list of supported languages.

docs/events.rst

+16-3
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,25 @@ changeDate
3939
Fired when the date is changed.
4040

4141

42+
changeMonth
43+
-----------
44+
45+
Fired when the *view* month is changed from year view.
46+
47+
4248
changeYear
4349
----------
4450

4551
Fired when the *view* year is changed from decade view.
4652

47-
changeMonth
48-
-----------
4953

50-
Fired when the *view* month is changed from year view.
54+
changeDecade
55+
------------
56+
57+
Fired when the *view* decade is changed from century view.
58+
59+
60+
changeCentury
61+
-------------
62+
63+
Fired when the *view* century is changed from millennium view.

docs/index.rst

+3-13
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Please note that this fork is not used on Stefan's page at this time, nor is it
1212

1313
Versions are incremented according to `semver <http://semver.org/>`_.
1414

15-
`Online Demo <http://eternicode.github.io/bootstrap-datepicker/>`_
15+
`Online Demo <https://eternicode.github.io/bootstrap-datepicker/>`_
1616

1717

1818
Requirements
@@ -21,8 +21,8 @@ Requirements
2121
* `Bootstrap`_ 2.0.4+
2222
* `jQuery`_ 1.7.1+
2323

24-
.. _Bootstrap: http://getbootstrap.com/
25-
.. _jQuery: http://jquery.com/
24+
.. _Bootstrap: https://getbootstrap.com/
25+
.. _jQuery: https://jquery.com/
2626

2727
These are the specific versions bootstrap-datepicker is tested against (``js`` files) and built against (``css`` files). Use other versions at your own risk.
2828

@@ -129,13 +129,3 @@ Table of Contents
129129
events
130130
keyboard
131131
i18n
132-
133-
134-
135-
Indices and tables
136-
==================
137-
138-
* :ref:`genindex`
139-
* :ref:`modindex`
140-
* :ref:`search`
141-

docs/methods.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Methods are called on a datepicker by calling the ``datepicker`` function with a
99

1010

1111
destroy
12-
------
12+
-------
1313

1414
Arguments: None
1515

docs/options.rst

+20-20
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ String. Default: "body"
130130

131131
Appends the date picker popup to a specific element; eg: container: '#picker-container' (will default to "body")
132132

133-
.. _daysofweekdisabled:
133+
.. _datesdisabled:
134134

135135

136136
datesDisabled
@@ -140,7 +140,7 @@ String, Array. Default: []
140140

141141
Array of date strings or a single date string formatted in the given date format
142142

143-
.. _defaultviewdate:
143+
.. _daysofweekdisabled:
144144

145145

146146
daysOfWeekDisabled
@@ -163,7 +163,7 @@ String, Array. Default: []
163163

164164
Days of the week that should be highlighted. Values are 0 (Sunday) to 6 (Saturday). Multiple values should be comma-separated. Example: highlight weekends: ``'06'`` or ``'0,6'`` or ``[0,6]``.
165165

166-
.. _datesdisabled:
166+
.. _defaultviewdate:
167167

168168

169169
defaultViewDate
@@ -177,8 +177,6 @@ Date to view when initially opening the calendar. The internal value of the date
177177
* ``month``: 0
178178
* ``day``: 1
179179

180-
.. _enddate:
181-
182180

183181
disableTouchKeyboard
184182
--------------------
@@ -195,6 +193,8 @@ Boolean. Default: true
195193

196194
If false the datepicker will not show on a readonly datepicker field.
197195

196+
.. _enddate:
197+
198198

199199
endDate
200200
-------
@@ -329,7 +329,7 @@ maxViewMode
329329

330330
Number, String. Default: 4, "centuries"
331331

332-
Set a maximum limit for the view mode. Accepts: "days" or 0, "months" or 1, "years" or 2, "decades" or 3, and "centuries" or 4.
332+
Set a maximum limit for the view mode. Accepts: 0 or "days" or "month", 1 or "months" or "year", 2 or "years" or "decade", 3 or "decades" or "century", and 4 or "centuries" or "millenium".
333333
Gives the ability to pick only a day, a month, a year or a decade. The day is set to the 1st for "months", the month is set to January for "years", the year is set to the first year from the decade for "decades", and the year is set to the first from the millennium for "centuries".
334334

335335

@@ -338,7 +338,7 @@ minViewMode
338338

339339
Number, String. Default: 0, "days"
340340

341-
Set a minimum limit for the view mode. Accepts: "days" or 0, "months" or 1, "years" or 2, "decades" or 3, and "centuries" or 4.
341+
Set a minimum limit for the view mode. Accepts: 0 or "days" or "month", 1 or "months" or "year", 2 or "years" or "decade", 3 or "decades" or "century", and 4 or "centuries" or "millenium".
342342
Gives the ability to pick only a month, a year or a decade. The day is set to the 1st for "months", and the month is set to January for "years", the year is set to the first year from the decade for "decades", and the year is set to the first from the millennium for "centuries".
343343

344344

@@ -374,8 +374,6 @@ A space-separated string consisting of one or two of "left" or "right", "top" or
374374

375375
"auto" triggers "smart orientation" of the picker. Horizontal orientation will default to "left" and left offset will be tweaked to keep the picker inside the browser viewport; vertical orientation will simply choose "top" or "bottom", whichever will show more of the picker in the viewport.
376376

377-
.. _startdate:
378-
379377

380378
showOnFocus
381379
-----------
@@ -384,6 +382,7 @@ Boolean. Default: true
384382

385383
If false, the datepicker will be prevented from showing when the input field associated with it receives focus.
386384

385+
.. _startdate:
387386

388387
startDate
389388
---------
@@ -399,9 +398,9 @@ The earliest date that may be selected; all earlier dates will be disabled.
399398
startView
400399
---------
401400

402-
Number, String. Default: 0, "month"
401+
Number, String. Default: 0, "days"
403402

404-
The view that the datepicker should show when it is opened. Accepts values of 0 or "month" for month view (the default), 1 or "year" for the 12-month overview, 2 or "decade" for the 10-year overview, 3 or "century" for the 10-decade overview, and 4 or "millennium" for the 10-century overview. Useful for date-of-birth datepickers.
403+
The view that the datepicker should show when it is opened. Accepts: 0 or "days" or "month", 1 or "months" or "year", 2 or "years" or "decade", 3 or "decades" or "century", and 4 or "centuries" or "millenium". Useful for date-of-birth datepickers.
405404

406405

407406
templates
@@ -498,29 +497,30 @@ beforeShowYear
498497
beforeShowDecade
499498
beforeShowCentury
500499
calendarWeeks false
501-
clearBtncontainer false
500+
clearBtn false
501+
container 'body'
502502
datesDisabled []
503503
daysOfWeekDisabled []
504504
daysOfWeekHighlighted []
505505
defaultViewDate today
506506
disableTouchKeyboard false
507507
enableOnReadonly true
508-
endDate
508+
endDate Infinity
509509
forceParse true
510510
assumeNearbyYear false
511-
format mm/dd/yyyy
511+
format 'mm/dd/yyyy'
512512
immediateUpdates false
513513
inputs
514514
keyboardNavigation true
515-
language en
515+
language 'en'
516516
maxViewMode 4 'centuries'
517-
minViewMode 0 'day'
517+
minViewMode 0 'days'
518518
multidate false
519-
multidateSeparator ","
520-
orientation auto
519+
multidateSeparator ','
520+
orientation 'auto'
521521
showOnFocus true
522-
startDate 0
523-
startView 'month' (current)
522+
startDate -Infinity
523+
startView 0 'days' (current month)
524524
templates
525525
title ''
526526
todayBtn false

js/bootstrap-datepicker.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* =========================================================
22
* bootstrap-datepicker.js
33
* Repo: https://github.com/eternicode/bootstrap-datepicker/
4-
* Demo: http://eternicode.github.io/bootstrap-datepicker/
5-
* Docs: http://bootstrap-datepicker.readthedocs.org/
4+
* Demo: https://eternicode.github.io/bootstrap-datepicker/
5+
* Docs: https://bootstrap-datepicker.readthedocs.org/
66
* Forked from http://www.eyecon.ro/bootstrap-datepicker
77
* =========================================================
88
* Started by Stefan Petre; improvements by Andrew Rowls + contributors
@@ -668,6 +668,7 @@
668668
this._process_options({datesDisabled: datesDisabled});
669669
this.update();
670670
this.updateNavArrows();
671+
return this;
671672
},
672673

673674
place: function(){

package.json

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
"bootstrap"
99
],
1010
"main": "./dist/js/bootstrap-datepicker.js",
11+
"files": [
12+
"build",
13+
"dist",
14+
"js/**/*.js",
15+
"less/*.less",
16+
"LICENSE"
17+
],
1118
"homepage": "https://github.com/eternicode/bootstrap-datepicker",
1219
"author": "Andrew Rowls <[email protected]>",
1320
"scripts": {

tests/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Unit tests, written with [QUnit](http://docs.jquery.com/QUnit), are used to
1+
Unit tests, written with [QUnit](https://qunitjs.com), are used to
22
expose bugs for squashing, prevent bugs from respawning, and suppress new
33
bugs when adding new features and making changes.
44

@@ -15,7 +15,7 @@ repo:
1515

1616
# Adding tests
1717

18-
Tests go in js files in the `tests/suites/` directory tree. QUnit organizes
18+
Tests go in js files in the `tests/suites/` directory tree. QUnit organizes
1919
tests into suites called "modules"; there is one module per js file. If the
2020
tests you are adding do not fit into an existing module, create a new one at
2121
`tests/suites/<new module>.js`, where `<new module>` is a broad yet

tests/assets/jquery-2.2.3.min.js

-4
This file was deleted.

0 commit comments

Comments
 (0)