Migrate wekan-fullcalendar to npm FullCalendar v5 and remove Meteor moment package

This commit is contained in:
Harry Adel 2026-02-24 23:07:05 +02:00
parent d796c4d9bb
commit 1b74fd8d4e
21 changed files with 415 additions and 233 deletions

View file

@ -1,4 +1,5 @@
import { ReactiveCache } from '/imports/reactiveCache';
import { formatDateByUserPreference } from '/imports/lib/dateUtils';
Template.notification.events({
'click .read-status .materialCheckBox'() {
@ -38,9 +39,15 @@ Template.notification.helpers({
const user = ReactiveCache.getCurrentUser();
if (!user) return '';
const dateFormat = user.getDateFormat ? user.getDateFormat() : 'L';
const timeFormat = user.getTimeFormat ? user.getTimeFormat() : 'LT';
const dateObj = new Date(activity.createdAt);
if (Number.isNaN(dateObj.getTime())) return '';
return moment(activity.createdAt).format(`${dateFormat} ${timeFormat}`);
const dateFormat = user.getDateFormat ? user.getDateFormat() : 'YYYY-MM-DD';
const datePart = formatDateByUserPreference(dateObj, dateFormat, false);
const timePart = dateObj.toLocaleTimeString([], {
hour: 'numeric',
minute: '2-digit',
});
return `${datePart} ${timePart}`.trim();
},
});