Skip to content

Commit

Permalink
fix(FeedSourceTable): fix calendar expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
evansiroky committed Aug 11, 2017
1 parent faf9f74 commit 8010af4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/manager/components/FeedSourceTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,16 @@ class FeedSourceAttributes extends Component {
render () {
const { feedSource, messages } = this.props
const dateFormat = getConfigProperty('application.date_format')
const hasErrors = feedSource.latestValidation && feedSource.latestValidation.errorCount > 0
const hasVersion = feedSource.latestValidation
const isExpired = feedSource.latestValidation && feedSource.latestValidation.endDate < +moment()
const end = feedSource.latestValidation && moment(feedSource.latestValidation.endDate)
const endDate = end && end.format(dateFormat)
const timeTo = end && moment().to(end)
let hasErrors, latestValidationEndMoment, isExpired, endDate, timeTo
if (hasVersion) {
hasErrors = hasVersion && feedSource.latestValidation.errorCount > 0
latestValidationEndMoment = moment(feedSource.latestValidation.endDate, 'YYYYMMDD')
isExpired = hasVersion && latestValidationEndMoment.isBefore(moment())
endDate = latestValidationEndMoment.format(dateFormat)
timeTo = moment().to(latestValidationEndMoment)
}

return (
<ul className='list-inline' style={{marginBottom: '0px'}}>
<Attribute
Expand Down

0 comments on commit 8010af4

Please sign in to comment.