import { toEST, toESTDateDisplay } from './timezoneUtils';

/**
 * Formatter specifically designed for PDF Reports to ensure consistent EST output.
 */
export const reportDateFormatter = {
  /**
   * Full timestamp with timezone abbreviation
   * e.g. "Jan 15, 2026 2:30 PM EST"
   */
  full: (date) => toEST(date, 'MMM d, yyyy h:mm a zzz'),

  /**
   * Date only
   * e.g. "Jan 15, 2026"
   */
  dateOnly: (date) => toESTDateDisplay(date),

  /**
   * Short Date
   * e.g. "01/15/2026"
   */
  shortDate: (date) => toEST(date, 'MM/dd/yyyy'),

  /**
   * Time only
   * e.g. "2:30 PM EST"
   */
  timeOnly: (date) => toEST(date, 'h:mm a zzz'),
  
  /**
   * Returns current date in report format
   */
  now: () => toEST(new Date(), 'MMM d, yyyy h:mm a zzz')
};

export default reportDateFormatter;
