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

atinc / ngx-tethys / 129e0fd3-b436-4e51-a99e-27a86ab79bed

14 Dec 2023 05:55AM UTC coverage: 90.399% (-0.009%) from 90.408%
129e0fd3-b436-4e51-a99e-27a86ab79bed

Pull #2969

circleci

luxiaobei
feat(property): property-item add thyEditingChange #INFR-10910
Pull Request #2969: feat(property): property-item add thyEditingChange #INFR-10910

5353 of 6582 branches covered (0.0%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 2 files covered. (100.0%)

20 existing lines in 5 files now uncovered.

13336 of 14092 relevant lines covered (94.64%)

972.82 hits per line

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

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

8
/**
9
 * @private
1✔
10
 */
11
@Pipe({
28✔
12
    name: 'thyDatePickerFormat',
13
    standalone: true
14
})
55✔
15
export class ThyDatePickerFormatPipe implements PipeTransform {
55✔
16
    constructor(private dateHelper: DateHelperService) {}
46!
17

18
    transform(originalValue: CompatibleDate | DateEntry | ThyDateRangeEntry, formatStr?: string): string {
55!
19
        const { value, withTime, flexibleDateGranularity } = transformDateValue(originalValue);
55✔
20

21
        if (!formatStr) {
22
            formatStr = withTime ? 'yyyy-MM-dd HH:mm' : 'yyyy-MM-dd';
×
23
        }
×
24

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

38
/**
39
 * @private
40
 */
41
@Pipe({
42
    name: 'thyDatePickerFormatString',
43
    standalone: true
44
})
45
export class ThyDatePickerFormatStringPipe implements PipeTransform {
46
    constructor(private dateHelper: DateHelperService) {}
1✔
47

UNCOV
48
    transform(originalValue: CompatibleDate | DateEntry | ThyDateRangeEntry): string {
×
49
        const { withTime } = transformDateValue(originalValue);
50

UNCOV
51
        return withTime ? 'yyyy-MM-dd HH:mm' : 'yyyy-MM-dd';
×
UNCOV
52
    }
×
53
}
54

1✔
55
/**
56
 * @private
57
 */
58
@Pipe({
1✔
59
    name: 'showYearTip',
60
    standalone: true
61
})
62
export class DatePickerAdvancedShowYearTipPipe implements PipeTransform {
63
    constructor() {}
64
    transform(value: AdvancedSelectableCell, type: ThyDateGranularity): boolean {
65
        return type !== 'year' && value.startValue.isSameDay(value.startValue.startOfYear());
66
    }
67
}
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