---
-0.5.4 / 2015-11-19
+0.5.6 / 2015-11-20
+------------------
+
+`fix` use another method to change time and fix the bug about value.getTime().
+
+0.5.4 / 2015-11-20
------------------
`update` change value prop to defaultValue.
-0.5.2 / 2015-11-19
+0.5.2 / 2015-11-20
------------------
`update` renew placements config.
onItemChange(type, itemValue) {
const { value, onChange } = this.props;
- let index = 4;
- if (type === 'minute') {
- index = 5;
- } else if (type === 'second') {
- index = 6;
+ if (type === 'hour') {
+ value.setHourOfDay(itemValue);
+ } else if (type === 'minute') {
+ value.setMinutes(itemValue);
+ } else {
+ value.setSeconds(itemValue);
}
- value.fields[index] = itemValue;
onChange(value);
},
render() {
const { prefixCls, value } = this.props;
- const timeFields = value.fields;
return (
<div className={`${prefixCls}-combobox`}>
- {this.getHourSelect(timeFields[4])}
- {this.getMinuteSelect(timeFields[5])}
- {this.getSectionSelect(timeFields[6])}
+ {this.getHourSelect(value.getHourOfDay())}
+ {this.getMinuteSelect(value.getMinutes())}
+ {this.getSectionSelect(value.getSeconds())}
</div>
);
},
if (value) {
if (
- hourOptions.indexOf(value.fields[4]) < 0 ||
- minuteOptions.indexOf(value.fields[5]) < 0 ||
- secondOptions.indexOf(value.fields[6]) < 0
+ hourOptions.indexOf(value.getHourOfDay()) < 0 ||
+ minuteOptions.indexOf(value.getMinutes()) < 0 ||
+ secondOptions.indexOf(value.getSeconds()) < 0
) {
this.setState({
invalid: true,
if (originalValue && value) {
if (
- originalValue.fields[4] !== value.fields[4] ||
- originalValue.fields[5] !== value.fields[5] ||
- originalValue.fields[6] !== value.fields[6]
+ originalValue.getHourOfDay() !== value.getHourOfDay() ||
+ originalValue.getMinutes() !== value.getMinutes() ||
+ originalValue.getSeconds() !== value.getSeconds()
) {
onChange(value);
}