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

atinc / ngx-tethys / d9ae709b-3c27-4b69-b125-b8b80b54f90b

pending completion
d9ae709b-3c27-4b69-b125-b8b80b54f90b

Pull #2757

circleci

mengshuicmq
fix: fix code review
Pull Request #2757: feat(color-picker): color-picker support disabled (#INFR-8645)

98 of 6315 branches covered (1.55%)

Branch coverage included in aggregate %.

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

2392 of 13661 relevant lines covered (17.51%)

83.12 hits per line

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

60.0
/src/date-picker/date-picker.config.ts
1
import { InjectionToken } from '@angular/core';
2
import { addDays, addWeeks, startOfDay, startOfWeek, subDays } from 'date-fns';
3
import { TinyDate } from 'ngx-tethys/util';
4
import { CompatiblePresets, ThyShortcutPosition } from './standard-types';
1✔
5

6
export interface ThyDatePickerConfig {
7
    shortcutPosition: ThyShortcutPosition;
8
    shortcutDatePresets: CompatiblePresets;
×
9
    shortcutRangesPresets: CompatiblePresets;
10
    showShortcut: boolean;
11
}
12

13
export const DEFAULT_DATE_PICKER_CONFIG: ThyDatePickerConfig = {
14
    shortcutPosition: 'left',
15
    showShortcut: false,
16
    shortcutDatePresets: () => {
17
        return [
18
            {
19
                title: '今天',
20
                value: startOfDay(new Date()).getTime()
21
            },
22
            {
23
                title: '明天',
24
                value: startOfDay(addDays(new Date(), 1)).getTime()
×
25
            },
26
            {
27
                title: '下周',
28
                value: startOfWeek(addWeeks(new Date(), 1), { weekStartsOn: 1 }).getTime()
29
            }
30
        ];
31
    },
32
    shortcutRangesPresets: () => {
33
        return [
34
            {
35
                title: '最近 7 天',
36
                value: [new TinyDate(subDays(new Date(), 6)).getTime(), new TinyDate().endOfDay().getTime()]
37
            },
38
            {
39
                title: '最近 30 天',
40
                value: [new TinyDate(subDays(new Date(), 29)).getTime(), new TinyDate().endOfDay().getTime()]
41
            },
42
            {
43
                title: '本周',
44
                value: [new TinyDate().startOfWeek({ weekStartsOn: 1 }).getTime(), new TinyDate().endOfWeek({ weekStartsOn: 1 }).getTime()]
1✔
45
            },
1✔
46
            {
47
                title: '本月',
48
                value: [new TinyDate().startOfMonth().getTime(), new TinyDate().endOfMonth().getTime()]
49
            }
50
        ];
51
    }
52
};
53

54
export const THY_DATE_PICKER_CONFIG = new InjectionToken<ThyDatePickerConfig>('thy-date-picker-config');
55

56
export const THY_DATE_PICKER_CONFIG_PROVIDER = {
57
    provide: THY_DATE_PICKER_CONFIG,
58
    useValue: DEFAULT_DATE_PICKER_CONFIG
59
};
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