Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
kelp404 committed Jun 24, 2018
1 parent b86f9f1 commit c8314d2
Show file tree
Hide file tree
Showing 10 changed files with 2,946 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# 2 space indentation
[*.{coffee,html,scss,json,yml}]
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# OS X
.DS_Store

# bower components
/bower_components/

# node modules
/node_modules/

# WebStorm
/.idea/
27 changes: 27 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
path = require 'path'


module.exports = (grunt) ->
require('time-grunt') grunt
require('load-grunt-tasks') grunt

grunt.config.init
coffee:
build:
files:
"#{path.join('dist', 'datepicker.js')}": [
path.join 'src', '*.coffee'
]
sass:
options:
precision: 10
build:
files:
"#{path.join('dist', 'datepicker.css')}": [
path.join 'src', '*.scss'
]

grunt.registerTask 'build', [
'coffee:build'
'sass:build'
]
55 changes: 54 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
# angularjs-bootstrap-datepicker
The Bootstrap3 datepicker for AngularJS.


## Start
```html
<link type="text/css" rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.10/angular.js"></script>

<!-- datepicker -->
<link type="text/css" rel="stylesheet" href="/bower_components/angularjs-bootstrap-datepicker/dist/datepicker.css"/>
<script type="text/javascript" src="/bower_components/angularjs-bootstrap-datepicker/dist/datepicker.js"></script>
```

## Example
```js
angular.module('your-module', ['bootstrap.datepicker'])
.controller('YourController', ['$scope', function ($scope) {
$scope.form = {
date: null
};
}]);
```

```html
<div class="form-group">
<label class="control-label" for="input-date">Date</label>
<input ng-model="form.date"
bootstrap-datepicker="{format: 'yyyy-MM-dd'}"
class="form-control"
id="input-date" type="text" placeholder="yyyy-MM-dd"/>
</div>
```

## Options
```js
bootstrap-datepicker = {
format: 'M/d/yyyy',
days: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
months: [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
]
};
```
17 changes: 17 additions & 0 deletions dist/datepicker.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.bootstrap-datepicker {
margin: 5px 0 0;
position: absolute;
z-index: 1031;
width: 250px;
background-color: #fff; }
.bootstrap-datepicker tr.pa-days {
font-weight: bold; }
.bootstrap-datepicker th, .bootstrap-datepicker td {
cursor: pointer;
text-align: center; }
.bootstrap-datepicker th:hover, .bootstrap-datepicker td:hover {
background: #ddd; }
.bootstrap-datepicker th, .bootstrap-datepicker td {
padding: 5px !important; }
.bootstrap-datepicker td.selected {
background: #5bc0de; }
Loading

0 comments on commit c8314d2

Please sign in to comment.