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

OneBusAway / wayfinder / 25970026383

16 May 2026 06:50PM UTC coverage: 80.079%. First build
25970026383

Pull #466

github

web-flow
Merge 9274fa127 into 45e206306
Pull Request #466: Fix trip planner timezone: use agency timezone instead of browser/system timezone

1827 of 2021 branches covered (90.4%)

Branch coverage included in aggregate %.

29 of 57 new or added lines in 5 files covered. (50.88%)

11487 of 14605 relevant lines covered (78.65%)

4.65 hits per line

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

65.31
/src/lib/dateTimeInput.js
1
import { plainTimeToDate } from '$lib/dateTimeFormat';
1✔
2

3
const fourDigit24HourTimeFormat = new Intl.DateTimeFormat(undefined, {
1✔
4
        hour: '2-digit',
1✔
5
        minute: '2-digit',
1✔
6
        hour12: false
1✔
7
});
1✔
8

9
/**
1✔
10
 * Get today's date in YYYY-MM-DD format for date input
1✔
11
 *
1✔
12
 * @param {string} [timeZone] - IANA timezone (e.g. "America/Los_Angeles"). Defaults to browser's local timezone.
1✔
13
 * @returns {string} Today's date in YYYY-MM-DD format
1✔
14
 */
1✔
15
export function getTodayDateForInput(timeZone) {
1✔
16
        try {
2✔
17
                return Temporal.Now.plainDateISO(timeZone).toJSON();
2✔
18
        } catch (err) {
2!
NEW
19
                if (err instanceof RangeError) {
×
NEW
20
                        console.error(`getTodayDateForInput: invalid timezone "${timeZone}", falling back to local`);
×
NEW
21
                        return Temporal.Now.plainDateISO().toJSON();
×
NEW
22
                }
×
NEW
23
                throw err;
×
NEW
24
        }
×
25
}
2✔
26

27
/**
1✔
28
 * Get current time in HH:MM format for time input
1✔
29
 *
1✔
30
 * @param {string} [timeZone] - IANA timezone (e.g. "America/Los_Angeles"). Defaults to browser's local timezone.
1✔
31
 * @returns {string} Current time in HH:MM format
1✔
32
 */
1✔
33
export function getCurrentTimeForInput(timeZone) {
1✔
34
        let now;
3✔
35
        try {
3✔
36
                now = Temporal.Now.plainTimeISO(timeZone);
3✔
37
        } catch (err) {
3!
NEW
38
                if (err instanceof RangeError) {
×
NEW
39
                        console.error(
×
NEW
40
                                `getCurrentTimeForInput: invalid timezone "${timeZone}", falling back to local`
×
NEW
41
                        );
×
NEW
42
                        now = Temporal.Now.plainTimeISO();
×
NEW
43
                } else {
×
NEW
44
                        throw err;
×
NEW
45
                }
×
NEW
46
        }
×
47
        return fourDigit24HourTimeFormat.format(plainTimeToDate(now));
3✔
48
}
3✔
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