Skip to content

Commit

Permalink
Feedbacks | Update date/time formats
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Oct 15, 2024
1 parent d0768c9 commit e9c4c94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export const LANGUAGES = [
]


export const DATE_FORMAT = 'MM/DD/YYYY';
export const TIME_FORMAT = 'hh:mm A';
export const DATE_FORMAT = 'M/D/YYYY';
export const TIME_FORMAT = 'h:mm A';
export const DATETIME_FORMAT = DATE_FORMAT + ' ' + TIME_FORMAT;
export const DEFAULT_LIMIT = 25;
export const EMPTY_VALUE = '-';
Expand Down
4 changes: 2 additions & 2 deletions src/components/repos/RepoVersionLabel.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import moment from 'moment'
import { useTranslation } from 'react-i18next';
import VersionIcon from '@mui/icons-material/AccountTreeOutlined';
import startCase from 'lodash/startCase'
import { SECONDARY_COLORS } from '../../common/colors'
import HeaderChip from '../common/HeaderChip'
import { formatDate } from '../../common/utils'

const RepoVersionLabel = ({ version }) => {
const { t } = useTranslation()
Expand All @@ -26,7 +26,7 @@ const RepoVersionLabel = ({ version }) => {
size='small'
/>
<span style={{fontSize: '12px', marginLeft: '-4px', color: SECONDARY_COLORS.main }}>
{` ${startCase(t('common.updated_on'))} ${moment(version?.updated_on).format('MM/DD/YYYY')}`}
{` ${startCase(t('common.updated_on'))} ${formatDate(version?.updated_on)}`}
</span>
</React.Fragment>
)
Expand Down
8 changes: 4 additions & 4 deletions src/components/repos/VersionMeta.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import moment from 'moment'
import { useTranslation } from 'react-i18next';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
Expand All @@ -10,6 +9,7 @@ import TableRow from '@mui/material/TableRow';
import Skeleton from '@mui/material/Skeleton';
import get from 'lodash/get'
import RepoVersionLabel from './RepoVersionLabel'
import { formatDate } from '../../common'

const StatRow = ({icon, label, version1, version2, statKey, statFunc}) => {
const lastCellStyle = {borderBottom: '1px solid', borderColor: 'surface.nv80'}
Expand Down Expand Up @@ -129,7 +129,7 @@ const VersionMeta = ({version1, version2}) => {
label={t('repo.release_status')}
version1={version1}
version2={version2}
statFunc={version => version.released ? moment(version.updated_on).format('MM/DD/YYYY') : null }
statFunc={version => version.released ? formatDate(version.updated_on) : null }
/>
<StatRow
label={t('repo.visibility')}
Expand Down Expand Up @@ -171,13 +171,13 @@ const VersionMeta = ({version1, version2}) => {
label={t('common.created_on')}
version1={version1}
version2={version2}
statFunc={version => moment(version.created_on).format('MM/DD/YYYY') }
statFunc={version => formatDate(version.created_on) }
/>
<StatRow
label={t('common.updated_on')}
version1={version1}
version2={version2}
statFunc={version => moment(version.updated_on).format('MM/DD/YYYY') }
statFunc={version => formatDate(version.updated_on) }
/>
<StatRow
label={t('common.created_by')}
Expand Down

0 comments on commit e9c4c94

Please sign in to comment.