+ client: add jsdocs with returning format of date format functions
This commit is contained in:
parent
108cf73a30
commit
a3020275a2
@ -116,12 +116,12 @@ class Logs extends Component {
|
|||||||
checkWhiteList = reason => reason === FILTERED_STATUS.NOT_FILTERED_WHITE_LIST;
|
checkWhiteList = reason => reason === FILTERED_STATUS.NOT_FILTERED_WHITE_LIST;
|
||||||
|
|
||||||
getTimeCell = ({ value }) => (
|
getTimeCell = ({ value }) => (
|
||||||
<div className="logs__row">
|
<div className="logs__row">
|
||||||
<span className="logs__text" title={formatDateTime(value)}>
|
<span className="logs__text" title={formatDateTime(value)}>
|
||||||
{formatTodayDate(value) === formatTodayDate(Date.now())
|
{formatTodayDate(value) === formatTodayDate(Date.now())
|
||||||
? formatTime(value) : formatDateTime(value)}
|
? formatTime(value) : formatDateTime(value)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
getDomainCell = (row) => {
|
getDomainCell = (row) => {
|
||||||
|
@ -19,11 +19,19 @@ import {
|
|||||||
DNS_RECORD_TYPES,
|
DNS_RECORD_TYPES,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string The time to format
|
||||||
|
* @returns string Returns the time in the format HH:mm:ss
|
||||||
|
*/
|
||||||
export const formatTime = (time) => {
|
export const formatTime = (time) => {
|
||||||
const parsedTime = dateParse(time);
|
const parsedTime = dateParse(time);
|
||||||
return dateFormat(parsedTime, 'HH:mm:ss');
|
return dateFormat(parsedTime, 'HH:mm:ss');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string The date to format
|
||||||
|
* @returns string Returns the date and time in the format DD/MM/YYYY, HH:mm
|
||||||
|
*/
|
||||||
export const formatDateTime = (dateTime) => {
|
export const formatDateTime = (dateTime) => {
|
||||||
const currentLanguage = i18n.languages[0] || 'en';
|
const currentLanguage = i18n.languages[0] || 'en';
|
||||||
const parsedTime = dateParse(dateTime);
|
const parsedTime = dateParse(dateTime);
|
||||||
@ -39,6 +47,10 @@ export const formatDateTime = (dateTime) => {
|
|||||||
return parsedTime.toLocaleString(currentLanguage, options);
|
return parsedTime.toLocaleString(currentLanguage, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string The date to format
|
||||||
|
* @returns string Returns the date in the format DD/MM/YYYY
|
||||||
|
*/
|
||||||
export const formatTodayDate = (dateTime) => {
|
export const formatTodayDate = (dateTime) => {
|
||||||
const currentLanguage = i18n.languages[0] || 'en';
|
const currentLanguage = i18n.languages[0] || 'en';
|
||||||
const parsedTime = dateParse(dateTime);
|
const parsedTime = dateParse(dateTime);
|
||||||
|
Loading…
Reference in New Issue
Block a user