mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 22:01:13 +00:00
Give function better name
This commit is contained in:
parent
25e9acee39
commit
2b8ee2fa31
1 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ interface MomentTimeProps {
|
||||||
ignoreUpdated?: boolean;
|
ignoreUpdated?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function momentFormat(input: string) {
|
function formatDate(input: string) {
|
||||||
return format(parseISO(input), "PPPPpppp");
|
return format(parseISO(input), "PPPPpppp");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,11 +25,11 @@ export class MomentTime extends Component<MomentTimeProps, any> {
|
||||||
const updated = this.props.updated;
|
const updated = this.props.updated;
|
||||||
let line = `${capitalizeFirstLetter(
|
let line = `${capitalizeFirstLetter(
|
||||||
I18NextService.i18n.t("created")
|
I18NextService.i18n.t("created")
|
||||||
)}: ${momentFormat(this.props.published)}`;
|
)}: ${formatDate(this.props.published)}`;
|
||||||
if (updated) {
|
if (updated) {
|
||||||
line += `\n\n\n${capitalizeFirstLetter(
|
line += `\n\n\n${capitalizeFirstLetter(
|
||||||
I18NextService.i18n.t("modified")
|
I18NextService.i18n.t("modified")
|
||||||
)} ${momentFormat(updated)}`;
|
)} ${formatDate(updated)}`;
|
||||||
}
|
}
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ export class MomentTime extends Component<MomentTimeProps, any> {
|
||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
className="moment-time pointer unselectable"
|
className="moment-time pointer unselectable"
|
||||||
data-tippy-content={momentFormat(published)}
|
data-tippy-content={formatDate(published)}
|
||||||
>
|
>
|
||||||
{formatPastDate(published)}
|
{formatPastDate(published)}
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue