Skip to content

Instantly share code, notes, and snippets.

@moaoa
Created September 25, 2023 21:08
Show Gist options
  • Select an option

  • Save moaoa/e8c4e44fb8f17bb8664f6298b515a028 to your computer and use it in GitHub Desktop.

Select an option

Save moaoa/e8c4e44fb8f17bb8664f6298b515a028 to your computer and use it in GitHub Desktop.

Revisions

  1. moaoa created this gist Sep 25, 2023.
    7 changes: 7 additions & 0 deletions moment_format_date.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import moment from "moment";

    const formatDate = (date) => {
    const momntDate = moment(date);
    if (!momntDate.isValid()) "";
    return moment(date).format("D-MM-YYYY");
    };