diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-08-23 17:02:50 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-08-23 17:33:55 +0800 |
commit | c048639a46be107578e8ce0d8721bc7b5d4fe791 (patch) | |
tree | 3dd670c62d70897df604237bd99fc2562045fe9f /usecaseui-portal/src/app/shared | |
parent | 1ed096510209590d1656489a74692eb5ebcdeee4 (diff) |
feat:optimize public function and home page api
Change-Id: Idf849f381af9adbfae7d8a6e012d8949d170c666
Issue-ID: USECASEUI-307
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/shared')
-rw-r--r-- | usecaseui-portal/src/app/shared/utils/utils.js | 0 | ||||
-rw-r--r-- | usecaseui-portal/src/app/shared/utils/utils.ts | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/shared/utils/utils.js b/usecaseui-portal/src/app/shared/utils/utils.js deleted file mode 100644 index e69de29b..00000000 --- a/usecaseui-portal/src/app/shared/utils/utils.js +++ /dev/null diff --git a/usecaseui-portal/src/app/shared/utils/utils.ts b/usecaseui-portal/src/app/shared/utils/utils.ts new file mode 100644 index 00000000..abdb9836 --- /dev/null +++ b/usecaseui-portal/src/app/shared/utils/utils.ts @@ -0,0 +1,18 @@ +export class Util{ + // Time formatting milliseconds to normal + dateformater(vmstime) { + if (!vmstime) { + return '' + } + let mstime = Number((vmstime + '').slice(0, 13)); + let time = new Date(mstime); + let year = time.getFullYear(); + let month = time.getMonth() + 1; + let day = time.getDate(); + let hours = time.getHours(); + let minutes = time.getMinutes(); + let seconds = time.getSeconds(); + let formattime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; + return formattime; + } +}
\ No newline at end of file |