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
729e6276
Commit
729e6276
authored
Jun 20, 2018
by
Juorder Gonzalez quiñonez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix display renovation date, now use memomentjs
parent
97d4775c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
domain_general_info.jsx
src/components/domain/domain_general_info.jsx
+1
-14
utils.jsx
src/utils/utils.jsx
+16
-0
No files found.
src/components/domain/domain_general_info.jsx
View file @
729e6276
...
...
@@ -73,20 +73,7 @@ export default class DomainGeneralInfo extends React.Component {
}
}
renovationDate
()
{
const
utc
=
Utils
.
getUTCTime
(
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'
);
return
Utils
.
getRenovationDate
(
this
.
props
.
domain
.
attrs
.
zimbraCreateTimestamp
);
}
render
()
{
const
domain
=
this
.
props
.
domain
;
...
...
src/utils/utils.jsx
View file @
729e6276
...
...
@@ -885,6 +885,22 @@ export function isDevMode() {
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
)
{
let
time
=
utc
;
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