mirror of
https://github.com/owncast/owncast.git
synced 2024-11-22 04:40:37 +03:00
fix: check if date is invalid
This commit is contained in:
parent
8c380f118a
commit
29ef90e384
1 changed files with 3 additions and 0 deletions
|
@ -281,6 +281,9 @@ export function convertOnPaste( event = { preventDefault() {} }) {
|
|||
|
||||
export function formatTimestamp(sentAt) {
|
||||
sentAt = new Date(sentAt);
|
||||
if (isNaN(sentAt)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
let diffInDays = ((new Date()) - sentAt) / (24 * 3600 * 1000);
|
||||
if (diffInDays >= 1) {
|
||||
|
|
Loading…
Reference in a new issue