]> Untitled Git - lemmy-ui.git/commitdiff
Give function better name
authorSleeplessOne1917 <abias1122@gmail.com>
Fri, 23 Jun 2023 18:33:26 +0000 (14:33 -0400)
committerSleeplessOne1917 <abias1122@gmail.com>
Fri, 23 Jun 2023 18:33:26 +0000 (14:33 -0400)
src/shared/components/common/moment-time.tsx

index fc83ab46d9e9e57be4f848604d243bb86cb32bfb..7c5693ed061e512421284a36305caf3963803892 100644 (file)
@@ -12,7 +12,7 @@ interface MomentTimeProps {
   ignoreUpdated?: boolean;
 }
 
-function momentFormat(input: string) {
+function formatDate(input: string) {
   return format(parseISO(input), "PPPPpppp");
 }
 
@@ -25,11 +25,11 @@ export class MomentTime extends Component<MomentTimeProps, any> {
     const updated = this.props.updated;
     let line = `${capitalizeFirstLetter(
       I18NextService.i18n.t("created")
-    )}: ${momentFormat(this.props.published)}`;
+    )}: ${formatDate(this.props.published)}`;
     if (updated) {
       line += `\n\n\n${capitalizeFirstLetter(
         I18NextService.i18n.t("modified")
-      )} ${momentFormat(updated)}`;
+      )} ${formatDate(updated)}`;
     }
     return line;
   }
@@ -50,7 +50,7 @@ export class MomentTime extends Component<MomentTimeProps, any> {
       return (
         <span
           className="moment-time pointer unselectable"
-          data-tippy-content={momentFormat(published)}
+          data-tippy-content={formatDate(published)}
         >
           {formatPastDate(published)}
         </span>