mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-19 04:26:39 +00:00
return go time in Format RFC3339 to match js Date (#785)
Signed-off-by: Hongchao Deng <hongchaodeng1@gmail.com>
This commit is contained in:
@@ -4,7 +4,6 @@ import { Button, Card, message, Popconfirm, Space, Table } from 'antd';
|
||||
import { Link, useModel, useRequest } from 'umi';
|
||||
|
||||
import { deleteApplication, getApplications } from '@/services/application';
|
||||
import compatibleDayjs from '@/utils/compatibleDayjs';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { PageContainer } from '@ant-design/pro-layout';
|
||||
|
||||
@@ -81,7 +80,7 @@ export default () => {
|
||||
dataIndex: 'createdTime',
|
||||
key: 'createdTime',
|
||||
render: (text) => {
|
||||
return compatibleDayjs(text).format('YYYY-MM-DD HH:mm:ss');
|
||||
return text;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import dayjs from 'dayjs';
|
||||
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
||||
import timezone from 'dayjs/plugin/timezone';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
|
||||
dayjs.extend(customParseFormat);
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
|
||||
const FORMAT = 'YYYY-MM-DD HH:mm:ss ZZ';
|
||||
|
||||
export default function compatibleDayjs(date: string) {
|
||||
return dayjs(date, FORMAT).tz();
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -153,7 +154,7 @@ func RetrieveApplicationStatusByName(ctx context.Context, c client.Client, appli
|
||||
}
|
||||
applicationMeta.Name = appConfig.Name
|
||||
applicationMeta.Status = status
|
||||
applicationMeta.CreatedTime = appConfig.CreationTimestamp.String()
|
||||
applicationMeta.CreatedTime = appConfig.CreationTimestamp.Format(time.RFC3339)
|
||||
|
||||
for _, com := range appConfig.Spec.Components {
|
||||
componentName := com.ComponentName
|
||||
|
||||
Reference in New Issue
Block a user