Skip to content

Commit

Permalink
fix: getDocumentDate type (#231)
Browse files Browse the repository at this point in the history
fix: gerDocumentDate
  • Loading branch information
mdanilowicz authored May 25, 2023
1 parent e359aa2 commit 24acfb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-candles-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vue-demo-store": patch
---

fix getDocument date type
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const getMediaFileHandler = async (documentObject: OrderDocument) => {
);
};
const getDocumentDate = (documentDate: Date) =>
const getDocumentDate = (documentDate: Date | string) =>
new Date(documentDate).toLocaleDateString(
(typeof navigator !== "undefined" && navigator.language) || "en-US"
);
Expand All @@ -37,7 +37,11 @@ const getDocumentDate = (documentDate: Date) =>
<span class="text-brand-dark">{{
document.config.title || document.config.name
}}</span>
({{ getDocumentDate(document.updatedAt) }})
({{
getDocumentDate(
document.updatedAt ? document.updatedAt : document.createdAt
)
}})
</li>
</ul>
</div>
Expand Down

2 comments on commit 24acfb9

@vercel
Copy link

@vercel vercel bot commented on 24acfb9 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 24acfb9 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

frontends-demo – ./templates/vue-demo-store

frontends-demo-shopware-frontends.vercel.app
frontends-demo.vercel.app
frontends-demo-git-main-shopware-frontends.vercel.app

Please sign in to comment.