Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Adding possibility to clear the selector and the properties clearable, disabled and placeholder. #54

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,31 @@ render: function() {
return <DateTimeField />;
}
```
See [Examples](examples/README.md) for more details.
See [Examples](examples/) for more details.

API
===============================

DateTimeField
========

| Name | Type | Default | Description |
| ------------ | ------- | ------- | ----------- |
| **dateTime** | string | moment().format('x') | Represents the inital dateTime, this string is then parsed by moment.js |
| **format** | string | "x" | Defines the format moment.js should use to parse and output the date to onChange |
| **inputFormat** | string | "MM/DD/YY h:mm A" | Defines the way the date is represented in the HTML input |
| **onChange** | function | x => console.log(x) | Callback trigger when the date changes |
| **showToday** | boolean | true | Highlights today's date |
| **daysOfWeekDisabled** | array of integer | [] | Disables clicking on some days. Goes from 0 (Sunday) to 6 (Saturday). |
| **viewMode** | string or number | 'days' | The default view to display when the picker is shown. ('years', 'months', 'days') |
| **inputProps** | object | undefined | Defines additional attributes for the input element of the component. |
| **minDate** | moment | undefined | The earliest date allowed for entry in the calendar view. |
| **maxDate** | moment | undefined | The latest date allowed for entry in the calendar view. |
| Name | Type | Default | Description |
| ------------ | ------- | ------- | ----------- |
| **dateTime** | string | moment().format('x') | Represents the inital view dateTime, this string is then parsed by moment.js |
| **value** | string | undefined | Represent the selectedDate of the picker. |
| **placeholder** | string | "Select a Date" | Placeholder of the input field (replace defaultText). |
| **clearable** | boolean | false | Defined if the selector should offer the possibility to clean the selected date. |
| **disabled** | boolean | false | Defines if the selector its enabled or disabled. |
| **format** | string | "x" | Defines the format moment.js should use to parse and output the date to onChange |
| **inputFormat** | string | "MM/DD/YY h:mm A" | Defines the way the date is represented in the HTML input |
| **onChange** | function | x => console.log(x) | Callback trigger when the date changes |
| **showToday** | boolean | true | Highlights today's date |
| **daysOfWeekDisabled** | array of integer | [] | Disables clicking on some days. Goes from 0 (Sunday) to 6 (Saturday). |
| **viewMode** | string or number | 'days' | The default view to display when the picker is shown. ('years', 'months', 'days') |
| **inputProps** | object | undefined | Defines additional attributes for the input element of the component. |
| **minDate** | moment | undefined | The earliest date allowed for entry in the calendar view. |
| **maxDate** | moment | undefined | The latest date allowed for entry in the calendar view. |
| **mode** | string | undefined | Allows to selectively display only the time picker ('time') or the date picker ('date') |

Update Warning
===============================
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-bootstrap-datetimepicker",
"version": "0.0.15",
"version": "0.0.17",
"main": [
"./dist/react-bootstrap-datetimepicker.min.js"
],
Expand Down
8 changes: 8 additions & 0 deletions css/bootstrap-datetimepicker.css
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@
width: 16px;
height: 16px;
}
.input-group.date span.input-group-clear {
cursor: pointer;
position: absolute;
z-index: 10;
left: calc(100% - 57px);
color: #dddddd;
line-height: 32px;
}
.bootstrap-datetimepicker-widget.left-oriented:before {
left: auto;
right: 6px;
Expand Down
2 changes: 1 addition & 1 deletion css/bootstrap-datetimepicker.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading