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

u-wave / core / 20206995276

14 Dec 2025 11:03AM UTC coverage: 85.96% (+0.009%) from 85.951%
20206995276

push

github

web-flow
Remove date-fns (#729)

1001 of 1192 branches covered (83.98%)

Branch coverage included in aggregate %.

48 of 54 new or added lines in 5 files covered. (88.89%)

10442 of 12120 relevant lines covered (86.16%)

98.16 hits per line

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

88.24
/src/utils/date.js
1
// A minimal set of date-fns-style functions used by üWave.
1✔
2
// Inspiration: https://date-fns.org/
1✔
3

1✔
4
export const MS_PER_SECOND = 1_000;
1✔
5
export const MS_PER_MINUTE = MS_PER_SECOND * 60;
1✔
6
export const MS_PER_HOUR = MS_PER_MINUTE * 60;
1✔
7
export const MS_PER_DAY = MS_PER_HOUR * 24;
1✔
8
export const MS_PER_WEEK = MS_PER_DAY * 7;
1✔
9

1✔
10
/**
1✔
11
 * @param {Date} date
1✔
12
 * @param {Date} dateToCompare
1✔
13
 */
1✔
14
export function isBefore(date, dateToCompare) {
1✔
NEW
15
  return +date < +dateToCompare;
×
NEW
16
}
×
17

1✔
18
/**
1✔
19
 * @param {Date} date
1✔
20
 * @param {number} millis
1✔
21
 */
1✔
22
export function addMilliseconds(date, millis) {
1✔
23
  return new Date(+date + millis);
4✔
24
}
4✔
25

1✔
26
/**
1✔
27
 * @param {Date} date
1✔
28
 * @param {number} minutes
1✔
29
 */
1✔
30
export function subMinutes(date, minutes) {
1✔
NEW
31
  return new Date(+date - minutes * MS_PER_MINUTE);
×
NEW
32
}
×
33

1✔
34
/**
1✔
35
 * @param {Date} date
1✔
36
 * @param {number} hours
1✔
37
 */
1✔
38
export function addHours(date, hours) {
1✔
NEW
39
  return new Date(+date + hours * MS_PER_HOUR);
×
NEW
40
}
×
41

1✔
42
/**
1✔
43
 * @param {Date} date
1✔
44
 * @param {number} hours
1✔
45
 */
1✔
46
export function subHours(date, hours) {
1✔
47
  return new Date(+date - hours * MS_PER_HOUR);
2✔
48
}
2✔
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