Skip to content

Commit

Permalink
Allow mixing ago with date formats
Browse files Browse the repository at this point in the history
  • Loading branch information
TarheelGrad1998 committed Mar 18, 2023
1 parent 510128e commit 73d7caa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gallery-card.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var GalleryCardVersion="3.4";
var GalleryCardVersion="3.4.1";

import {
LitElement,
Expand Down Expand Up @@ -666,8 +666,10 @@ class GalleryCard extends LitElement {
if (date && captionFormat) {
if (captionFormat.toUpperCase().trim() == 'AGO')
fileCaption = date.fromNow();
else
else {
fileCaption = date.format(captionFormat);
fileCaption = fileCaption.replace(/ago/ig, date.fromNow());
}
}

resource = {
Expand Down

0 comments on commit 73d7caa

Please sign in to comment.