summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/shared/utils/utils.ts
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2019-08-23 17:02:50 +0800
committercyuamber <xuranyjy@chinamobile.com>2019-08-23 17:33:55 +0800
commitc048639a46be107578e8ce0d8721bc7b5d4fe791 (patch)
tree3dd670c62d70897df604237bd99fc2562045fe9f /usecaseui-portal/src/app/shared/utils/utils.ts
parent1ed096510209590d1656489a74692eb5ebcdeee4 (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/utils/utils.ts')
-rw-r--r--usecaseui-portal/src/app/shared/utils/utils.ts18
1 files changed, 18 insertions, 0 deletions
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