import dayjs from 'dayjs';

// Module "updated" dates, e.g. "Jul 30, 2026". Fixed format (not locale
// dependent) so the modules list and the module page always agree.
export const formatModuleDate = (value?: string | number | null): string => {
  if (!value) return '';
  const date = dayjs(value);
  return date.isValid() ? date.format('MMM D, YYYY') : '';
};
