Skip to content

Commit 8b56524

Browse files
committed
RI-5934 code prettify
1 parent 2f99a56 commit 8b56524

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

redisinsight/ui/src/pages/settings/components/general-settings/datetime-formatter/DateTimeFormatter.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const DateTimeFormatter = () => {
9292
}
9393

9494
const showError = !!error || !formik.values.customFormat
95-
const getBtnIconType = () => (showError ? 'iInCircle' : saveFormatSucceed ? icheck : undefined)
95+
const getBtnIconType = () => (showError ? 'iInCircle' : (saveFormatSucceed ? icheck : undefined))
9696

9797
const handleFormatCheck = (format = formik.values.format, timezone = formik.values.timezone) => {
9898
const { valid, error: errorMsg } = checkDateTimeFormat(format, timezone)
@@ -186,7 +186,7 @@ const DateTimeFormatter = () => {
186186
<div className={styles.radioLabelTextContainer}>
187187
<EuiText color="subdued" className={styles.radioLabelText}>Custom</EuiText>
188188
</div>
189-
{formik.values.selectedRadioOption === DatetimeRadioOption.Custom ? (
189+
{formik.values.selectedRadioOption === DatetimeRadioOption.Custom && (
190190
<>
191191
<EuiFieldText
192192
className={styles.datetimeInput}
@@ -216,7 +216,7 @@ const DateTimeFormatter = () => {
216216
</EuiButton>
217217
</EuiToolTip>
218218
</>
219-
) : null}
219+
)}
220220
</div>)
221221
}
222222
]

redisinsight/ui/src/pages/settings/components/general-settings/datetime-formatter/styles.module.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
}
3838

3939
.dateTimeSubtitle {
40-
font: normal normal normal 14px/24px Graphik !important;
40+
font-family: 'Graphik',san-serif !important;
41+
font-weight: 400;
42+
font-size: 13px;
43+
line-height: 18px;
44+
font-style: normal;
4145
letter-spacing: -0.14px;
4246
}
4347

@@ -46,7 +50,7 @@
4650
}
4751

4852
.preview {
49-
font-family: SourceCodePro;
53+
font-family: 'SourceCodePro',san-serif;
5054
font-size: 14px !important;
5155
font-weight: 400;
5256
line-height: 17.6px !important;

redisinsight/ui/src/utils/transformers/formatDate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addMilliseconds, format as formatDateFns, formatDistanceToNow, isValid } from 'date-fns'
1+
import { addMilliseconds, format as formatDateFns, formatDistanceToNow, isValid, isDate } from 'date-fns'
22
import { format as formatDateTZ, toZonedTime } from 'date-fns-tz'
33
import { DATETIME_FORMATTER_DEFAULT, TimezoneOption } from 'uiSrc/constants'
44
import { truncateNumberToFirstUnit } from './truncateTTL'
@@ -85,7 +85,7 @@ export const formatTimestamp = (
8585
timezone: TimezoneOption = TimezoneOption.Local
8686
): string => {
8787
try {
88-
if ((value instanceof Date) && Object.prototype.toString.call(value) === '[object Date]') {
88+
if (isDate(value)) {
8989
return formatDateInternal(value, format, timezone)
9090
}
9191
return formatStringTimestamp(value.toString(), format, timezone)

0 commit comments

Comments
 (0)