@@ -12,6 +12,7 @@ import DOMPurify from "dompurify";
1212import MarkdownIt from " markdown-it" ;
1313import defaultPluginIcon from " /favicon.svg" ;
1414import { pluginApi } from " @/api/v1" ;
15+ import { useI18n } from " @/i18n/composables" ;
1516import { usePluginI18n } from " @/utils/pluginI18n" ;
1617import PluginPlatformChip from " @/components/shared/PluginPlatformChip.vue" ;
1718
@@ -35,6 +36,7 @@ const props = defineProps({
3536});
3637
3738const { tm , router } = props .state ;
39+ const { locale } = useI18n ();
3840const {
3941 pluginName ,
4042 pluginDesc: resolvePluginDesc ,
@@ -233,6 +235,29 @@ const supportPlatformsDisplay = computed(() => {
233235 return platforms .filter ((platform ) => typeof platform === " string" );
234236});
235237
238+ const updatedAtDisplay = computed (() => {
239+ if (! isMarketDetail .value ) return " " ;
240+
241+ const value = firstPresentValue (
242+ pluginData .value ? .updated_at ,
243+ props .marketPlugin ? .updated_at ,
244+ );
245+ if (! value) return " " ;
246+
247+ const updatedAt = new Date (value);
248+ if (Number .isNaN (updatedAt .getTime ())) return " " ;
249+
250+ return new Intl.DateTimeFormat (locale .value , {
251+ year: " numeric" ,
252+ month: " 2-digit" ,
253+ day: " 2-digit" ,
254+ hour: " 2-digit" ,
255+ minute: " 2-digit" ,
256+ second: " 2-digit" ,
257+ hour12: false ,
258+ }).format (updatedAt);
259+ });
260+
236261const infoRows = computed (() => {
237262 const rows = [
238263 {
@@ -251,6 +276,11 @@ const infoRows = computed(() => {
251276 value: starsDisplay .value ,
252277 optional: true ,
253278 },
279+ {
280+ label: tm (" detail.info.updatedAt" ),
281+ value: updatedAtDisplay .value ,
282+ optional: true ,
283+ },
254284 {
255285 label: tm (" detail.info.tags" ),
256286 value: tagsDisplay .value ,
0 commit comments