Skip to content

Commit

Permalink
Staging v3 changes
Browse files Browse the repository at this point in the history
## 3.0.0
## **Breaking changes in this update! Pay attention!!**
* Fix for #170, #179, #183: Changed event to `dp.-` options load as
`data-date-OPTION` instead of `data-OPTION`. This should fix the double
change event firing.
* Fix for #192: `setDate` now fires `dp.change`
* Fix for #182: Picker will **not** set the default date if the input
field has a value
* Fix for #169: Seconds doesn't get reset when changing the date (Thanks
to PR #174)
* Fix for #168 z-index fix for BS modal
* Fix for #155 Picker properly displays the active year and month
* Fix for #154 CSS update to fix the collapse jump
* Fix for #150 and #75 `minViewMode` and `viewMode` work properly
* Fix for #44 Finally! It's here!! Thanks to @ruiwei and his code on
#210 picker will adjust the positioning of the widget.

#### **Manually merged PR**
* #178 When using `minuteStepping` the minute select grid will only show
available steppings
* #195, #197 Using the `data-OPTION` has been changed to
`data-date-OPTION`. These options are expected to be on the
`input-group` if you're using the `form-group` **or** the input field
* #184 The option `sideBySide` change be used to display both the d and
the timepicker side by side

#### **Other Changes**
* Changed picker width to 300px if using seconds and am/pm
* Added option `useCurrent`, thanks to @ruiwei. When true, picker will
set the value to the current date/time (respects picker's format)
* Added option `showToday`, thanks to @ruiwei. When true, picker will
display a small arrow to indicate today's date.
* Changed `startDate` to `minDate` and `endDate` to `maxDate` to make it
more clear what these options do.
  • Loading branch information
Eonasdan committed Mar 3, 2014
1 parent 6a7299f commit d2f75f0
Show file tree
Hide file tree
Showing 10 changed files with 481 additions and 359 deletions.
12 changes: 3 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
Contributions guidelines:

- Use 2 spaces indentation
- If it is a bug, try to add an automated test that reproduces it in the
test/issues.coffee, following the conventions already adopted.
- If it is a new feature, try to add automated tests for it.
- Never submit patches that break existing tests(make test should take care of
downloading dependencies and running the tests)
- Do not commit the files in the 'build' dir, 'git update-index --assume-unchanged build/{js,css}/*' will help

Before starting to develop, enter 'make deps' to download all dependencies
needed for developing/testing. 'make test' will run all tests.
- If it is a bug, please read open issues to avoid duplicates
- If it is a new feature, please provide a use case. E.g. Why this feature should be added and what you are using it for
- If possible, please provide example code and/or a jdfiddle and a DETAILED example of what is not working
123 changes: 86 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,94 +1,148 @@
# Bootstrap v3 datetimepicker widget
# Bootstrap v3 datetimepicker widget ![GitHub version](https://badge.fury.io/gh/Eonasdan%2Fbootstrap-datetimepicker.png)

![DateTimePicker](http://i.imgur.com/nfnvh5g.png)

### [⇢ View the manual and demos](http://eonasdan.github.io/bootstrap-datetimepicker/)

##Where do you use this?
I'd love to know if your public site is using this plugin and list your logo on the documentation site. Please email me `eonasdan at outlook dot com`
I'd love to know if your public site is using this plugin and list your logo on the documentation site. Please email me `eonasdan at outlook dot com`. Do not submit issue/feature request to this email, they will be ignored.

## See the [Change Log](#change-log) for important changes and updates.

## Quick installation using

## [bower](http://bower.io):
## [bower](http://bower.io): ![Bower version](https://badge.fury.io/bo/eonasdan-bootstrap-datetimepicker.png)

Run the following command:
````
```
bower install eonasdan-bootstrap-datetimepicker#latest --save
````
## [Nuget](https://www.nuget.org/packages/Bootstrap.v3.Datetimepicker/):
````
PM> Install-Package Bootstrap.v3.Datetimepicker
````

## See the [Change Log](#change-log) for important changes and updates
```

Include necessary scripts and styles:
````html
```html
<head>
<!-- ... -->
<script type="text/javascript" src="/bower_components/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/bower_components/moment/min/moment.min.js"></script>
<script type="text/javascript" src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/bower_components/eonasdan-bootstrap-datetimepicker/build/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/boostrap.min.css" />
<script type="text/javascript" src="/bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="/bower_components/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" />
</head>
````
```

Done! [Now take a look at the manual](http://eonasdan.github.io/bootstrap-datetimepicker/) for examples and available options.
## [Nuget (LESS)](https://www.nuget.org/packages/Bootstrap.v3.Datetimepicker/): ![NuGet version](https://badge.fury.io/nu/Bootstrap.v3.Datetimepicker.png)
```
PM> Install-Package Bootstrap.v3.Datetimepicker
```

## [Nuget (CSS)](https://www.nuget.org/packages/Bootstrap.v3.Datetimepicker.CSS/): ![NuGet version](https://badge.fury.io/nu/Bootstrap.v3.Datetimepicker.CSS.png)
```
PM> Install-Package Bootstrap.v3.Datetimepicker.CSS
```

```html
<head>
<script type="text/javascript" src="/scripts/jquery.min.js"></script>
<script type="text/javascript" src="/scripts/moment.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap.min.js"></script>
<script type="text/javascript" src="/scripts/bootstrap-datetimepicker.min.js"></script>
<!-- include your less or built css files -->
<!--
bootstrap-datetimepicker-build.less will pull in "../bootstrap/variables.less" and "bootstrap-datetimepicker.less";
or
<link rel="stylesheet" href="/Content/bootstrap-datetimepicker.css" />
-->
</head>
```

## [Rails](http://rubygems.org/gems/bootstrap3-datetimepicker-rails) ![Gem Version](https://badge.fury.io/rb/bootstrap3-datetimepicker-rails.png)

Add the following to your `Gemfile`:
```
gem 'momentjs-rails', '~> 2.5.0'
gem 'bootstrap3-datetimepicker-rails', '~> 2.1.30'
```
Read the rest of the install instructions @
[TrevorS/bootstrap3-datetimepicker-rails](https://github.com/TrevorS/bootstrap3-datetimepicker-rails)

Done! [Now take a look at the manual](http://eonasdan.github.io/bootstrap-datetimepicker/) for examples and available options.


## Manual installation

### [Moment.js](https://github.com/moment/moment)
Datetimepicker requires moment.js. This allows for better support for various date formats and locales. See [documentation](http://eonasdan.github.io/bootstrap-datetimepicker/) for examples. Check [Momentjs' homepage](http://momentjs.com/) for documentation on date formats. If you can't use moment.js there's still older version of datetimewidget [available here](https://github.com/Eonasdan/bootstrap-datetimepicker/tree/version1).

````html
```html
<script type="text/javascript" src="/path/to/moment.js"></script>
````
```

### Bootstrap 3 collapse and transition plugins
Make sure to include *.JS files for plugins [collapse](http://getbootstrap.com/javascript/#collapse) and [transitions](http://getbootstrap.com/javascript/#transitions). They are included with [bootstrap in js/ directory](https://github.com/twbs/bootstrap/tree/master/js)

````html
```html
<script type="text/javascript" src="/path/to/bootstrap/js/transition.js"></script>
<script type="text/javascript" src="/path/to/bootstrap/js/collapse.js"></script>
````
```

Alternatively you could include the whole bundle of bootstrap plugins from [bootstrap.js](https://github.com/twbs/bootstrap/tree/master/dist/js)

````html
```html
<script type="text/javascript" src="/path/to/bootstrap/dist/bootstrap.min.js"></script>
````
```


### CSS styles

#### Using LESS
````css
@import "/path/to/bootstrap/variables";
```css
@import "/path/to/bootstrap/less/variables";
@import "/path/to/bootstrap-datetimepicker/src/less/bootstrap-datetimepicker";

// [...] your custom styles and variables
````

##### LESS Build File
You can also build `/path/to/bootstrap-datetimepicker/bootstrap-datetimepicker-build.less` to pull in Bootstraps `variables` file
```

#### Using CSS (default color palette)
````html
```html
<link rel="stylesheet" href="/path/to/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css" />
````
```

### Main JS file

Finally include the main javascript file.
````html
```html
<script type="text/javascript" src="/path/to/bootstrap-datetimepicker.min.js"></script>
````
```

# Change Log
## 3.0.0 - updates to the docs are coming soon
## **Breaking changes in this update! Pay attention!!**
* Fix for #170, #179, #183: Changed event to `dp.-` options load as `data-date-OPTION` instead of `data-OPTION`. This should fix the double change event firing.
* Fix for #192: `setDate` now fires `dp.change`
* Fix for #182: Picker will **not** set the default date if the input field has a value
* Fix for #169: Seconds doesn't get reset when changing the date (Thanks to PR #174)
* Fix for #168 z-index fix for BS modal
* Fix for #155 Picker properly displays the active year and month
* Fix for #154 CSS update to fix the collapse jump
* Fix for #150 and #75 `minViewMode` and `viewMode` work properly
* Fix for #44 Finally! It's here!! Thanks to @ruiwei and his code on #210 picker will adjust the positioning of the widget.

#### **Manually merged PR**
* #178 When using `minuteStepping` the minute select grid will only show available steppings
* #195, #197 Using the `data-OPTION` has been changed to `data-date-OPTION`. These options are expected to be on the `input-group` if you're using the `form-group` **or** the input field
* #184 The option `sideBySide` change be used to display both the d and the timepicker side by side

#### **Other Changes**
* Changed picker width to 300px if using seconds and am/pm
* Added option `useCurrent`, thanks to @ruiwei. When true, picker will set the value to the current date/time (respects picker's format)
* Added option `showToday`, thanks to @ruiwei. When true, picker will display a small arrow to indicate today's date.
* Changed `startDate` to `minDate` and `endDate` to `maxDate` to make it more clear what these options do.

## 2.1.32 (Hotfix)

* Fix for #151: When a bad date value or the picker is cleared, the plugin will not longer attempt to reset it back to the previous date
* Fix for #140: `setDate` can be given `null` to force clear the picker

## 2.1.30
#### Important! `build.less` file name has been been changed to `bootstrap-datetimepicker-build.less` to prevent collisions
Expand Down Expand Up @@ -134,8 +188,3 @@ Finally include the main javascript file.
* `disabledDates` is now an option to set the disabled dates. It accepts date objects like `new Date("November 12, 2013 00:00:00")` and `12/25/2013' and `moment` date objects. See [Example#7](http://eonasdan.github.io/bootstrap-datetimepicker/#example7) for usage.
* Events are easier to use; see [Example#8](http://eonasdan.github.io/bootstrap-datetimepicker/#example8)

###Removed features
* pickSeconds
* pick12HourFormat
* maskInput

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eonasdan-bootstrap-datetimepicker",
"version": "2.2.20",
"version": "2.2.22",
"main": [
"build/css/bootstrap-datetimepicker.min.css",
"build/js/bootstrap-datetimepicker.min.js"
Expand Down
64 changes: 47 additions & 17 deletions build/css/bootstrap-datetimepicker.css
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
/**
* Build file for the dist version of datetimepicker.css
*/
/*!
* Datetimepicker for Bootstrap v3
* https://github.com/Eonasdan/bootstrap-datetimepicker/
* Copyright 2012 Stefan Petre
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
.bootstrap-datetimepicker-widget {
top: 0;
left: 0;
width: 250px;
padding: 4px;
margin-top: 1px;
z-index: 99999;
z-index: 99999 !important;
border-radius: 4px;
/*.dow {
border-top: 1px solid #ddd !important;
}*/
}
.bootstrap-datetimepicker-widget .btn {
padding: 6px;
.bootstrap-datetimepicker-widget.timepicker-sbs {
width: 600px;
}
.bootstrap-datetimepicker-widget:before {
.bootstrap-datetimepicker-widget.bottom:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
Expand All @@ -33,18 +23,42 @@
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: -7px;
left: 6px;
left: 7px;
}
.bootstrap-datetimepicker-widget:after {
.bootstrap-datetimepicker-widget.bottom:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid white;
position: absolute;
top: -6px;
left: 8px;
}
.bootstrap-datetimepicker-widget.top:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid #ccc;
border-top-color: rgba(0, 0, 0, 0.2);
position: absolute;
bottom: -7px;
left: 6px;
}
.bootstrap-datetimepicker-widget.top:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid white;
position: absolute;
bottom: -6px;
left: 7px;
}
.bootstrap-datetimepicker-widget .dow {
width: 14.2857%;
}
.bootstrap-datetimepicker-widget.pull-right:before {
left: auto;
right: 6px;
Expand Down Expand Up @@ -97,12 +111,28 @@
.bootstrap-datetimepicker-widget td.new {
color: #999999;
}
.bootstrap-datetimepicker-widget td.today {
position: relative;
}
.bootstrap-datetimepicker-widget td.today:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-bottom: 7px solid #428bca;
border-top-color: rgba(0, 0, 0, 0.2);
position: absolute;
bottom: 4px;
right: 4px;
}
.bootstrap-datetimepicker-widget td.active,
.bootstrap-datetimepicker-widget td.active:hover {
background-color: #428bca;
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.bootstrap-datetimepicker-widget td.active.today:before {
border-bottom-color: #fff;
}
.bootstrap-datetimepicker-widget td.disabled,
.bootstrap-datetimepicker-widget td.disabled:hover {
background: none;
Expand Down Expand Up @@ -169,6 +199,6 @@
left: auto;
right: 7px;
}
.bootstrap-datetimepicker-widget ul.list-unstyled li.in div.timepicker div.timepicker-picker table.table-condensed tbody > tr > td {
.bootstrap-datetimepicker-widget ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody > tr > td {
padding: 0px !important;
}
Loading

0 comments on commit d2f75f0

Please sign in to comment.