{"version":3,"file":"format-date.cjs","names":[],"sources":["../../../src/utils/format-date/format-date.ts"],"sourcesContent":["import dayjs from 'dayjs';\nimport { DateLabelFormat } from '../../types';\n\nexport interface FormatDateInput {\n  locale: string;\n  date: string | Date | dayjs.Dayjs;\n  format: DateLabelFormat;\n}\n\nexport function formatDate({ locale, date, format }: FormatDateInput) {\n  if (typeof format === 'function') {\n    return format(dayjs(date).format('YYYY-MM-DD HH:mm:ss'));\n  }\n\n  return dayjs(date).locale(locale).format(format);\n}\n"],"mappings":";;;;;AASA,SAAgB,WAAW,EAAE,QAAQ,MAAM,UAA2B;CACpE,IAAI,OAAO,WAAW,YACpB,OAAO,QAAA,GAAA,MAAA,QAAA,CAAa,IAAI,CAAC,CAAC,OAAO,qBAAqB,CAAC;CAGzD,QAAA,GAAA,MAAA,QAAA,CAAa,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,MAAM;AACjD"}