• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / codegate-ui / 13325211149

14 Feb 2025 08:17AM UTC coverage: 68.625% (+0.02%) from 68.603%
13325211149

Pull #315

github

web-flow
Merge 7bf78fe19 into 0805f21ad
Pull Request #315: chore: configure prettier & apply formatting

364 of 590 branches covered (61.69%)

Branch coverage included in aggregate %.

360 of 519 new or added lines in 99 files covered. (69.36%)

5 existing lines in 4 files now uncovered.

769 of 1061 relevant lines covered (72.48%)

71.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.78
/src/lib/format-time.ts
1
import { formatDistanceToNow } from 'date-fns'
2

3
type Format = 'relative' | 'absolute'
4

5
export const formatTime = (
8✔
6
  date: Date,
7
  options: {
204✔
8
    format: Format
9
  } = {
10
    format: 'relative',
11
  }
12
) => {
13
  switch (options.format) {
218!
14
    case 'absolute':
15
      return date.toLocaleString()
14✔
16
    case 'relative':
17
      return formatDistanceToNow(date, {
204✔
18
        addSuffix: true,
19
      })
20
    default:
NEW
21
      return options.format satisfies never
×
22
  }
23
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc