Skip to content

Commit

Permalink
fix(datepicker): if value is null dont reset date to 1970 (#3207)
Browse files Browse the repository at this point in the history
fix if state.value == null _newState.value will set to '1970-01-01 08:00:00'
  • Loading branch information
chonggit authored and valorkin committed Dec 7, 2017
1 parent 4a7f2f0 commit 8761038
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/timepicker/reducer/timepicker.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ export function timepickerReducer(state = initialState, action: Action) {
};

if (state.config.showMeridian !== _newState.config.showMeridian) {
_newState.value = new Date(state.value);
if(state.value){
_newState.value = new Date(state.value);
}
}

return Object.assign({}, state, _newState);
Expand Down

0 comments on commit 8761038

Please sign in to comment.