From 348abeecb1e52aff639b95ed8d07f2b20132cfb4 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 6 Sep 2024 20:51:57 +0100 Subject: [PATCH] DEV: Use icon-rendering API for local-dates (#28788) This makes local-dates compatible with the fa6 upgrade in https://github.com/discourse/discourse/pull/28778 --- .../javascripts/initializers/discourse-local-dates.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js b/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js index 4ca311f6f31..3471554eef7 100644 --- a/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js +++ b/plugins/discourse-local-dates/assets/javascripts/initializers/discourse-local-dates.js @@ -7,7 +7,7 @@ import { addTagDecorateCallback, addTextDecorateCallback, } from "discourse/lib/to-markdown"; -import { renderIcon } from "discourse-common/lib/icon-library"; +import { iconHTML, renderIcon } from "discourse-common/lib/icon-library"; import { bind } from "discourse-common/utils/decorators"; import I18n from "discourse-i18n"; import generateDateMarkup from "discourse/plugins/discourse-local-dates/lib/local-date-markup-generator"; @@ -41,9 +41,7 @@ export function applyLocalDates(dates, siteSettings) { element.innerText = ""; element.insertAdjacentHTML( "beforeend", - ` - - + `${iconHTML("globe-americas")} ${localDateBuilder.formatted}` ); element.setAttribute("aria-label", localDateBuilder.textPreview);