Skip to content

Commit c8314d2

Browse files
committed
init
1 parent b86f9f1 commit c8314d2

File tree

10 files changed

+2946
-1
lines changed

10 files changed

+2946
-1
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# 2 space indentation
12+
[*.{coffee,html,scss,json,yml}]
13+
indent_style = space
14+
indent_size = 2

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# OS X
2+
.DS_Store
3+
4+
# bower components
5+
/bower_components/
6+
7+
# node modules
8+
/node_modules/
9+
10+
# WebStorm
11+
/.idea/

Gruntfile.coffee

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
path = require 'path'
2+
3+
4+
module.exports = (grunt) ->
5+
require('time-grunt') grunt
6+
require('load-grunt-tasks') grunt
7+
8+
grunt.config.init
9+
coffee:
10+
build:
11+
files:
12+
"#{path.join('dist', 'datepicker.js')}": [
13+
path.join 'src', '*.coffee'
14+
]
15+
sass:
16+
options:
17+
precision: 10
18+
build:
19+
files:
20+
"#{path.join('dist', 'datepicker.css')}": [
21+
path.join 'src', '*.scss'
22+
]
23+
24+
grunt.registerTask 'build', [
25+
'coffee:build'
26+
'sass:build'
27+
]

README.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,55 @@
11
# angularjs-bootstrap-datepicker
2-
The Bootstrap3 datepicker for AngularJS.
2+
3+
4+
## Start
5+
```html
6+
<link type="text/css" rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
7+
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
8+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.10/angular.js"></script>
9+
10+
<!-- datepicker -->
11+
<link type="text/css" rel="stylesheet" href="/bower_components/angularjs-bootstrap-datepicker/dist/datepicker.css"/>
12+
<script type="text/javascript" src="/bower_components/angularjs-bootstrap-datepicker/dist/datepicker.js"></script>
13+
```
14+
15+
## Example
16+
```js
17+
angular.module('your-module', ['bootstrap.datepicker'])
18+
.controller('YourController', ['$scope', function ($scope) {
19+
$scope.form = {
20+
date: null
21+
};
22+
}]);
23+
```
24+
25+
```html
26+
<div class="form-group">
27+
<label class="control-label" for="input-date">Date</label>
28+
<input ng-model="form.date"
29+
bootstrap-datepicker="{format: 'yyyy-MM-dd'}"
30+
class="form-control"
31+
id="input-date" type="text" placeholder="yyyy-MM-dd"/>
32+
</div>
33+
```
34+
35+
## Options
36+
```js
37+
bootstrap-datepicker = {
38+
format: 'M/d/yyyy',
39+
days: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
40+
months: [
41+
'January',
42+
'February',
43+
'March',
44+
'April',
45+
'May',
46+
'June',
47+
'July',
48+
'August',
49+
'September',
50+
'October',
51+
'November',
52+
'December'
53+
]
54+
};
55+
```

dist/datepicker.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.bootstrap-datepicker {
2+
margin: 5px 0 0;
3+
position: absolute;
4+
z-index: 1031;
5+
width: 250px;
6+
background-color: #fff; }
7+
.bootstrap-datepicker tr.pa-days {
8+
font-weight: bold; }
9+
.bootstrap-datepicker th, .bootstrap-datepicker td {
10+
cursor: pointer;
11+
text-align: center; }
12+
.bootstrap-datepicker th:hover, .bootstrap-datepicker td:hover {
13+
background: #ddd; }
14+
.bootstrap-datepicker th, .bootstrap-datepicker td {
15+
padding: 5px !important; }
16+
.bootstrap-datepicker td.selected {
17+
background: #5bc0de; }

0 commit comments

Comments
 (0)