LCOV - code coverage report
Current view: top level - src/platform/billing/composables - useLongDate.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 42.9 % 7 3
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import { useI18n } from 'vue-i18n'
       2              : 
       3              : /** Formats an ISO timestamp as a long localized UTC date, or '' when it is missing or invalid. */
       4           12 : export function useLongDate() {
       5           12 :   const { d } = useI18n()
       6              : 
       7            0 :   function longDate(raw: string | null | undefined): string {
       8            0 :     const date = raw ? new Date(raw) : null
       9            0 :     if (!date || Number.isNaN(date.getTime())) return ''
      10            0 :     return d(date, {
      11              :       year: 'numeric',
      12              :       month: 'long',
      13              :       day: 'numeric',
      14              :       timeZone: 'UTC'
      15              :     })
      16              :   }
      17              : 
      18           12 :   return { longDate }
      19              : }
        

Generated by: LCOV version 2.0-1