Skip to content

Commit

Permalink
ver. 0.9.16
Browse files Browse the repository at this point in the history
  • Loading branch information
qili.taoqili committed Jul 17, 2019
1 parent 03a72fb commit aeef5ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions demo/DateFormFieldDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Demo extends React.Component {
jsxvalues={{
date: '2019-06-24',
casDate: ['2016-01-02', '2017-02-03'],
cas1Date: ['2016-07-11 13:04:11', '2016-07-15 14:05:11'],
cas1Date: '',
casMetaDate: {
start: '2016-01-11',
end: '2016-02-12'
Expand Down Expand Up @@ -95,7 +95,7 @@ class Demo extends React.Component {
jsxtype="cascade"
jsxname="cas1Date"
jsxmod={this.state.mode}
useFormat
useFormat={false}
format="yyyy-MM-dd HH:mm:ss"
showTime={true}
jsxlabel="defaultValue"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uxcore-date-form-field",
"version": "0.9.15",
"version": "0.9.16",
"description": "uxcore-date-form-field component for uxcore.",
"repository": "https://github.com/uxcore/uxcore-date-form-field.git",
"author": "eternalsky",
Expand Down
5 changes: 4 additions & 1 deletion src/DateFormField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,10 @@ class DateFormField extends FormField {
const now = me.processTime(current.getTime());
let first = formatValue ? formatValue[0] : 0;
//如果显示时间,需要将时间点前移到当前日期的0点
if (first && first.replace && me.props.showTime) {
if (me.props.showTime && first) {
if (typeof first === "number") {
first = Formatter.date(first, me.props.format || 'YYYY-MM-DD HH:mm:ss')
}
first = first.replace(/\d{1,2}:\d{1,2}:\d{1,2}/, '00:00:00')
}
first = me.processTime(first);
Expand Down

0 comments on commit aeef5ce

Please sign in to comment.