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

Freegle / iznik-nuxt3 / c116036c-55fb-4d4e-a732-06fbe0906fc1

13 Oct 2025 12:31PM UTC coverage: 34.681% (-11.0%) from 45.694%
c116036c-55fb-4d4e-a732-06fbe0906fc1

push

circleci

edwh
Migrate logo API call from v1 to v2

1053 of 3928 branches covered (26.81%)

Branch coverage included in aggregate %.

0 of 1 new or added line in 1 file covered. (0.0%)

723 existing lines in 55 files now uncovered.

2722 of 6957 relevant lines covered (39.13%)

38.05 hits per line

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

22.78
/composables/useTimeFormat.js
1
// Vue v3 doesn't support filters, so we have a composable which defines methods to achieve the same goal.
2
import dayjs from 'dayjs'
3
import isToday from 'dayjs/plugin/isToday'
4
import advancedFormat from 'dayjs/plugin/advancedFormat'
5
import relativeTime from 'dayjs/plugin/relativeTime'
6
import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'
7
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'
8

9
dayjs.extend(advancedFormat)
6✔
10
dayjs.extend(relativeTime)
6✔
11
dayjs.extend(isToday)
6✔
12
dayjs.extend(isSameOrAfter)
6✔
13
dayjs.extend(isSameOrBefore)
6✔
14

15
export function earliestDate(dates, ofall) {
×
16
  // Find the earliest date which is in the future.
17
  const now = Date.now()
×
18
  let earliest = null
×
19
  let earliestDate = null
×
20

21
  for (let i = 0; i < dates?.length; i++) {
×
22
    const atime = new Date(dates[i].start).getTime()
×
23
    if ((ofall || atime >= now) && (!earliest || atime < earliest)) {
×
24
      earliest = atime
×
25
      earliestDate = dates[i]
×
26
    }
27
  }
28

29
  return earliestDate
×
30
}
31

32
export function addStrings(item, times) {
×
33
  // Add human readable versions of each date range.
34
  if (item) {
×
35
    for (let i = 0; i < item?.dates?.length; i++) {
×
36
      const date = item.dates[i]
×
37
      const startm = dayjs(date.start)
×
38
      let endm = dayjs(date.end)
×
39

40
      if (times) {
×
41
        endm = endm.isSame(startm, 'day')
×
42
          ? endm.format('HH:mm')
43
          : endm.format('ddd, Do MMM HH:mm')
44

45
        item.dates[i].string = {
×
46
          start: startm.format('ddd, Do MMM HH:mm'),
47
          end: endm,
48
          past: Date.now() > new Date(date.start),
49
        }
50
      } else {
51
        endm = endm.format('ddd, Do MMM')
×
52

53
        item.dates[i].string = {
×
54
          start: startm.format('ddd, Do MMM'),
55
          end: endm,
56
          past: Date.now() > new Date(date.start),
57
        }
58
      }
59
    }
60
  }
61

62
  return item
×
63
}
64

65
export function timeago(val, past) {
6✔
66
  let f = null
6✔
67

68
  // dayjs pluralises wrongly in some cases - we've seen 1 hours ago.
69
  const dePlural = /^1 (.*)s/
6✔
70

71
  const v = dayjs(val)
6✔
72
  f = v.fromNow()
6✔
73
  f = f.replace(dePlural, '1 $1')
6✔
74

75
  if (past && f === 'in a few seconds') {
6!
76
    f = 'just now'
×
77
  }
78

79
  return f
6✔
80
}
81

82
export function timeadapt(val) {
×
83
  const t = dayjs(val)
×
84

85
  if (t.isToday()) {
×
86
    // For today, just show the time.
87
    return t.format('HH:mm')
×
88
  } else {
89
    return t.format('DD MMM YYYY HH:mm')
×
90
  }
91
}
92

93
export function datelocale(val) {
×
94
  return dayjs(val).toLocaleString()
×
95
}
96

UNCOV
97
export function dateonly(val) {
×
UNCOV
98
  return dayjs(val).format('Do MMMM, YYYY')
×
99
}
100

101
export function datetime(val) {
×
102
  return dayjs(val).format('Do MMMM, YYYY HH:mm:ss')
×
103
}
104

105
export function datetimeshort(val) {
3✔
106
  return dayjs(val).format('Do MMM, YYYY HH:mm')
3✔
107
}
108

109
export function dateshort(val) {
×
110
  return dayjs(val).format('MMM DD, YYYY')
×
111
}
112

UNCOV
113
export function dateonlyNoYear(val) {
×
UNCOV
114
  return dayjs(val).format('Do MMMM')
×
115
}
116

117
export function weekdayshort(val) {
×
118
  return dayjs(val).format('dddd Do HH:mm a')
×
119
}
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

© 2026 Coveralls, Inc