Skip to content

Commit 684d5f3

Browse files
committed
Republish 1.0.4
1 parent adea6be commit 684d5f3

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

demo/src/Demo.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22

3+
import moment from 'moment'
34
import DateTimePicker from 'material-ui-datetimepicker';
45
import DatePickerDialog from 'material-ui/DatePicker/DatePickerDialog'
56
import TimePickerDialog from 'material-ui/TimePicker/TimePickerDialog';
@@ -22,7 +23,7 @@ export default class Demo extends React.Component {
2223

2324
setRandomValue = () => {
2425
const randomMilliseconds = getRandomValue(0, Date.now())
25-
this.setState({ selectedDate: randomMilliseconds })
26+
this.setState({ selectedDate: moment(randomMilliseconds) })
2627
}
2728

2829
render() {
@@ -38,6 +39,7 @@ export default class Demo extends React.Component {
3839
<DateTimePicker
3940
ref="picker"
4041
className="datepicker"
42+
returnMomentDate={false}
4143
DatePicker={DatePickerDialog}
4244
TimePicker={TimePickerDialog}
4345
floatingLabelText="Get my date"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "material-ui-datetimepicker",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Wrapper above material ui date and time pickers",
55
"main": "./dist/index.js",
66
"scripts": {

src/DateTimePicker.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ export default class DateTimePicker extends Component {
104104
onDatePickerDismiss: () => { },
105105
}
106106

107-
getInitialTime = () => (this.props.value ? moment(this.props.value) : null)
107+
// eslint-disable-next-line
108+
getInitialTime = () => this.props.value
109+
? moment(this.props.value)
110+
: null
108111

109112
state = {
110113
dateTime: this.getInitialTime(),
@@ -198,7 +201,7 @@ export default class DateTimePicker extends Component {
198201
datePickerMode, disableYearSelection, shouldDisableDate,
199202
hideCalendarDate, openToYearSelection, timePickerBodyStyle,
200203
okLabel, autoOkTimePicker, timePickerDialogStyle, clearIconStyle, style, textFieldStyle,
201-
minutesStep, timePickerDelay, defaultTime,
204+
minutesStep, timePickerDelay,
202205
showCurrentDateByDefault, returnMomentDate,
203206
DatePicker, TimePicker,
204207
onChange, onFocus,

0 commit comments

Comments
 (0)