forked from getredash/redash
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from getredash/master
pull from upstream 7.29.18
- Loading branch information
Showing
23 changed files
with
1,281 additions
and
686 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# Change Log | ||
|
||
## v5.0.0-Beta - UNRELEASED | ||
|
||
## v4.0.1 - 2018-05-02 | ||
|
||
### Added | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import moment from 'moment'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { react2angular } from 'react2angular'; | ||
import { DatePicker } from 'antd'; | ||
|
||
function DateInput({ | ||
value, | ||
onSelect, | ||
clientConfig, | ||
}) { | ||
const format = clientConfig.dateFormat || 'YYYY-MM-DD'; | ||
const defaultValue = moment(value, format); | ||
return ( | ||
<DatePicker | ||
{...(defaultValue.isValid() ? { defaultValue } : {})} | ||
format={format} | ||
placeholder="Select Date" | ||
onChange={onSelect} | ||
/> | ||
); | ||
} | ||
|
||
DateInput.propTypes = { | ||
value: PropTypes.instanceOf(Date), | ||
onSelect: PropTypes.func, | ||
}; | ||
|
||
DateInput.defaultProps = { | ||
value: Date.now(), | ||
onSelect: () => {}, | ||
}; | ||
|
||
export default function init(ngModule) { | ||
ngModule.component('dateInput', react2angular(DateInput, null, ['clientConfig'])); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import moment from 'moment'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { react2angular } from 'react2angular'; | ||
import { DatePicker } from 'antd'; | ||
|
||
function DateTimeInput({ | ||
value, | ||
withSeconds, | ||
onSelect, | ||
clientConfig, | ||
}) { | ||
const format = (clientConfig.dateFormat || 'YYYY-MM-DD') + | ||
(withSeconds ? ' HH:mm:ss' : ' HH:mm'); | ||
const defaultValue = moment(value, format); | ||
return ( | ||
<DatePicker | ||
showTime | ||
{...(defaultValue.isValid() ? { defaultValue } : {})} | ||
format={format} | ||
placeholder="Select Date and Time" | ||
onChange={onSelect} | ||
/> | ||
); | ||
} | ||
|
||
DateTimeInput.propTypes = { | ||
value: PropTypes.instanceOf(Date), | ||
withSeconds: PropTypes.bool, | ||
onSelect: PropTypes.func, | ||
}; | ||
|
||
DateTimeInput.defaultProps = { | ||
value: Date.now(), | ||
withSeconds: false, | ||
onSelect: () => {}, | ||
}; | ||
|
||
export default function init(ngModule) { | ||
ngModule.component('dateTimeInput', react2angular(DateTimeInput, null, ['clientConfig'])); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.