• 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

24.32
/src/date-picker/picker.pipes.ts
1
import { Pipe, PipeTransform } from '@angular/core';
2
import { DateHelperService } from './date-helper.service';
3
import { CompatibleDate, DateEntry, ThyDateRangeEntry, ThyDateGranularity } from './standard-types';
4
import { getFlexibleAdvancedReadableValue, transformDateValue } from './picker.util';
5
import { TinyDate } from 'ngx-tethys/util';
6
import { AdvancedSelectableCell } from './inner-types';
1✔
7

8
@Pipe({
×
9
    name: 'thyDatePickerFormat',
10
    standalone: true
11
})
×
12
export class ThyDatePickerFormatPipe implements PipeTransform {
×
13
    constructor(private dateHelper: DateHelperService) {}
×
14

15
    transform(originalValue: CompatibleDate | DateEntry | ThyDateRangeEntry, formatStr?: string): string {
×
16
        const { value, withTime, flexibleDateGranularity } = transformDateValue(originalValue);
×
17

18
        if (!formatStr) {
19
            formatStr = withTime ? 'yyyy-MM-dd HH:mm' : 'yyyy-MM-dd';
×
20
        }
×
21

×
22
        if (!Array.isArray(value)) {
23
            return this.dateHelper.format(value, formatStr);
24
        } else {
×
25
            if (flexibleDateGranularity && flexibleDateGranularity !== 'day') {
26
                const tinyDates = [new TinyDate(value[0]), new TinyDate(value[1])];
27
                return getFlexibleAdvancedReadableValue(tinyDates, flexibleDateGranularity);
28
            } else {
1✔
29
                return value.map(date => this.dateHelper.format(date, formatStr)).join(' ~ ');
30
            }
31
        }
32
    }
1✔
33
}
34

35
@Pipe({
36
    name: 'thyDatePickerFormatString',
37
    standalone: true
38
})
39
export class ThyDatePickerFormatStringPipe implements PipeTransform {
40
    constructor(private dateHelper: DateHelperService) {}
1✔
41

42
    transform(originalValue: CompatibleDate | DateEntry | ThyDateRangeEntry): string {
×
43
        const { withTime } = transformDateValue(originalValue);
44

45
        return withTime ? 'yyyy-MM-dd HH:mm' : 'yyyy-MM-dd';
×
46
    }
×
47
}
48
@Pipe({
1✔
49
    name: 'showYearTip',
50
    standalone: true
51
})
52
export class DatePickerAdvancedShowYearTipPipe implements PipeTransform {
1✔
53
    constructor() {}
54
    transform(value: AdvancedSelectableCell, type: ThyDateGranularity): boolean {
55
        return type !== 'year' && value.startValue.isSameDay(value.startValue.startOfYear());
56
    }
57
}
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