Commit 0f873385 authored by enahum's avatar enahum

Merge pull request #27 from ZBoxApp/renovation

Domain renovation date
parents 87cbfcbc 9d429774
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// See LICENSE.txt for license information. // See LICENSE.txt for license information.
import React from 'react'; import React from 'react';
import moment from 'moment';
import Panel from '../panel.jsx'; import Panel from '../panel.jsx';
import StatusLabel from '../status_label.jsx'; import StatusLabel from '../status_label.jsx';
...@@ -14,9 +15,11 @@ export default class DomainGeneralInfo extends React.Component { ...@@ -14,9 +15,11 @@ export default class DomainGeneralInfo extends React.Component {
super(props); super(props);
this.getMXRecord = this.getMXRecord.bind(this); this.getMXRecord = this.getMXRecord.bind(this);
this.renovationDate = this.renovationDate.bind(this);
this.state = { this.state = {
mx: null mx: null,
date: this.renovationDate()
}; };
} }
componentWillMount() { componentWillMount() {
...@@ -37,6 +40,16 @@ export default class DomainGeneralInfo extends React.Component { ...@@ -37,6 +40,16 @@ export default class DomainGeneralInfo extends React.Component {
} }
); );
} }
renovationDate() {
const timestamp = moment(this.props.domain.attrs.zimbraCreateTimestamp);
const now = moment();
timestamp.year(now.year());
if (timestamp.isBefore(now)) {
timestamp.add(1, 'year');
}
return timestamp.format('DD/MM/YYYY');
}
render() { render() {
const domain = this.props.domain; const domain = this.props.domain;
const infoBody = ( const infoBody = (
...@@ -66,7 +79,7 @@ export default class DomainGeneralInfo extends React.Component { ...@@ -66,7 +79,7 @@ export default class DomainGeneralInfo extends React.Component {
</li> </li>
<li> <li>
<strong>{'Próxima renovación: '}</strong> <strong>{'Próxima renovación: '}</strong>
{'19/10/2016'} {this.state.date}
</li> </li>
<li> <li>
</li> </li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment