Skip to content

Commit 537ef72

Browse files
committed
progress
1 parent b3be162 commit 537ef72

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/SLDSTimepicker/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ const defaultProps = {
5757
onDateChange (date) {
5858
console.log('onDateChange should be defined');
5959
},
60-
parser (str) {
61-
return new Date(str);
60+
parser (timeStr) {
61+
const date = new Date();
62+
const dateStr = date.toLocaleString(navigator.language, {year: 'numeric', month: 'numeric', day: 'numeric'});
63+
return new Date(dateStr+' '+timeStr);
6264
},
6365
placeholder: 'Pick Time',
6466
relativeYearFrom: -5,
@@ -234,7 +236,7 @@ module.exports = React.createClass({
234236
strValue:string
235237
});
236238
if(this.props.onDateChange){
237-
const d = this.props.parser(string)
239+
const d = this.props.parser(string);
238240
this.props.onDateChange(d);
239241
}
240242
}

0 commit comments

Comments
 (0)