(card) display last modification date

This commit is contained in:
Andrea Vos 2024-06-19 20:06:08 +02:00
parent 955ed07447
commit 6c40986151
6 changed files with 17 additions and 1 deletions

View File

@ -196,6 +196,10 @@
<section>
<OpinionLegend :custom="profile.opinions" :used="usedOpinions" />
<p v-if="!isStatic" class="text-muted small text-center">
<T>profile.lastUpdate</T><T>quotation.colon</T>
{{$date($ulidTime(profile.id))}}
</p>
</section>
</div>
</template>

View File

@ -875,6 +875,7 @@ profile:
invalidDate: 'Provided date is not valid'
publicEvents:
header: 'Events from the Queer Calendar'
lastUpdate: 'Card last updated'
share: 'Share'

View File

@ -1064,6 +1064,7 @@ profile:
invalidDate: 'Provided date is not valid'
publicEvents:
header: 'Events from the Queer Calendar'
lastUpdate: 'Card last updated'
share: 'Share'

View File

@ -1714,6 +1714,7 @@ profile:
invalidDate: 'Podana data nie jest poprawna'
publicEvents:
header: 'Wydarzenia z Kalendarza Queerowego'
lastUpdate: 'Ostatnia aktualizacja wizytówki'
census:
header: 'Spis'

View File

@ -95,7 +95,10 @@ const plugin: Plugin = ({ app, store }, inject) => {
}
script.classList.add(`${name}-script`);
// script.crossOrigin = 'true'; TODO proper fix (adding it breaks publift)
script.addEventListener('load', () => resolve());
script.addEventListener('load', () => {
script.classList.add('loaded');
resolve();
});
script.addEventListener('error', (event) => {
reject(new LoadScriptError(name, src, typeof event === 'string' ? event : event.type));
});
@ -136,6 +139,11 @@ const plugin: Plugin = ({ app, store }, inject) => {
return dt.toFormat('y-MM-dd HH:mm');
});
inject('date', (timestamp: number): string => {
const dt = DateTime.fromSeconds(timestamp);
return dt.toFormat('y-MM-dd');
});
inject('ulidTime', (ulid: string): number => {
return decodeTime(ulid) / 1000;
});

View File

@ -272,6 +272,7 @@ const fetchProfiles = async (db, username, self, opts = undefined) => {
}) ?? {};
const profile_obj = {
id: propv('id', () => profile.id),
opinions: propv('opinions', () => JSON.parse(profile.opinions)),
names: propv('names', () => {
return JSON.parse(profile.names).map((name) => {