Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zimbra-admin-api-js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
zimbra-admin-api-js
Commits
836adf4b
Unverified
Commit
836adf4b
authored
Jun 20, 2018
by
Juorder Gonzalez
Committed by
GitHub
Jun 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #298 from ZBoxApp/fix-utcdate-domains
fix display renovation date, now use memomentjs
parents
97d4775c
44455e09
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
17 deletions
+21
-17
.travis.yml
.travis.yml
+4
-2
domain_general_info.jsx
src/components/domain/domain_general_info.jsx
+1
-15
utils.jsx
src/utils/utils.jsx
+16
-0
No files found.
.travis.yml
View file @
836adf4b
language
:
node_js
language
:
node_js
node_js
:
node_js
:
'
7.10.0'
-
5.9.0
cache
:
directories
:
-
node_modules
sudo
:
required
sudo
:
required
before_install
:
before_install
:
-
sudo apt-get -qq update
-
sudo apt-get -qq update
...
...
src/components/domain/domain_general_info.jsx
View file @
836adf4b
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
import
React
from
'react'
;
import
React
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
PropTypes
from
'prop-types'
;
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'
;
...
@@ -73,20 +72,7 @@ export default class DomainGeneralInfo extends React.Component {
...
@@ -73,20 +72,7 @@ export default class DomainGeneralInfo extends React.Component {
}
}
}
}
renovationDate
()
{
renovationDate
()
{
const
utc
=
Utils
.
getUTCTime
(
this
.
props
.
domain
.
attrs
.
zimbraCreateTimestamp
);
return
Utils
.
getRenovationDate
(
this
.
props
.
domain
.
attrs
.
zimbraCreateTimestamp
);
if
(
!
utc
)
{
return
'No disponible'
;
}
const
timestamp
=
moment
.
utc
(
utc
);
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
;
...
...
src/utils/utils.jsx
View file @
836adf4b
...
@@ -885,6 +885,22 @@ export function isDevMode() {
...
@@ -885,6 +885,22 @@ export function isDevMode() {
return
process
.
env
.
NODE_ENV
===
'development'
;
return
process
.
env
.
NODE_ENV
===
'development'
;
}
}
export
function
getRenovationDate
(
creationDate
,
noAvailable
=
'No disponible'
)
{
if
(
!
creationDate
)
{
return
noAvailable
;
}
const
domainCreationDate
=
moment
(
creationDate
,
'YYYYMMDDHHmmssZ'
);
const
now
=
moment
();
domainCreationDate
.
year
(
now
.
year
());
if
(
domainCreationDate
.
isBefore
(
now
))
{
domainCreationDate
.
add
(
1
,
'year'
);
}
return
domainCreationDate
.
format
(
'DD/MM/YYYY'
);
}
export
function
getTSFromUTC
(
utc
)
{
export
function
getTSFromUTC
(
utc
)
{
let
time
=
utc
;
let
time
=
utc
;
if
(
!
time
)
{
if
(
!
time
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment