line |
true |
false |
branch |
23
|
0 |
0 |
explicit DateRel (string_view str, int fmt = InputFormat::all) { _error = parse(str, fmt); } |
25
|
16 |
0 |
DateRel (const Date& from, const Date& till) { set(from, till); } |
27
|
0 |
0 |
DateRel (const DateRel& source) { operator=(source); } |
57
|
4 |
0 |
optional till () const { return _from ? (*_from + *this) : optional(); } |
|
4 |
0 |
optional till () const { return _from ? (*_from + *this) : optional(); } |
|
4 |
0 |
optional till () const { return _from ? (*_from + *this) : optional(); } |
|
4 |
0 |
optional till () const { return _from ? (*_from + *this) : optional(); } |
|
0 |
0 |
optional till () const { return _from ? (*_from + *this) : optional(); } |
70
|
24 |
188 |
if (_from) return (*_from + *this).epoch() - _from->epoch(); |
|
24 |
0 |
if (_from) return (*_from + *this).epoch() - _from->epoch(); |
|
24 |
0 |
if (_from) return (*_from + *this).epoch() - _from->epoch(); |
79
|
2 |
2 |
if (_from) { |
80
|
2 |
0 |
auto till = *_from + *this; |
81
|
2 |
0 |
return panda::time::christ_days(till.year()) - panda::time::christ_days(_from->year()) + |
|
2 |
0 |
return panda::time::christ_days(till.year()) - panda::time::christ_days(_from->year()) + |
82
|
2 |
0 |
till.yday() - _from->yday() + double(hms_diff(till)) / 86400; |
|
2 |
0 |
till.yday() - _from->yday() + double(hms_diff(till)) / 86400; |
|
2 |
0 |
till.yday() - _from->yday() + double(hms_diff(till)) / 86400; |
88
|
4 |
4 |
if (_from) { |
89
|
4 |
0 |
auto till = *_from + *this; |
90
|
4 |
0 |
return (till.year() - _from->year())*12 + till.month() - _from->month() + |
|
4 |
0 |
return (till.year() - _from->year())*12 + till.month() - _from->month() + |
|
4 |
0 |
return (till.year() - _from->year())*12 + till.month() - _from->month() + |
|
4 |
0 |
return (till.year() - _from->year())*12 + till.month() - _from->month() + |
91
|
4 |
0 |
double(till.day() - _from->day() + double(hms_diff(till)) / 86400) / _from->days_in_month(); |
|
4 |
0 |
double(till.day() - _from->day() + double(hms_diff(till)) / 86400) / _from->days_in_month(); |
|
4 |
0 |
double(till.day() - _from->day() + double(hms_diff(till)) / 86400) / _from->days_in_month(); |
|
4 |
0 |
double(till.day() - _from->day() + double(hms_diff(till)) / 86400) / _from->days_in_month(); |
107
|
4 |
0 |
DateRel negated () const { return DateRel(*this).negate(); } |
|
4 |
0 |
DateRel negated () const { return DateRel(*this).negate(); } |
112
|
92 |
0 |
return _sec == operand._sec && _min == operand._min && _hour == operand._hour && |
|
92 |
0 |
return _sec == operand._sec && _min == operand._min && _hour == operand._hour && |
|
92 |
0 |
return _sec == operand._sec && _min == operand._min && _hour == operand._hour && |
113
|
92 |
0 |
_day == operand._day && _month == operand._month && _year == operand._year && _from == operand._from; |
|
91 |
1 |
_day == operand._day && _month == operand._month && _year == operand._year && _from == operand._from; |
|
91 |
0 |
_day == operand._day && _month == operand._month && _year == operand._year && _from == operand._from; |
|
91 |
0 |
_day == operand._day && _month == operand._month && _year == operand._year && _from == operand._from; |
117
|
2 |
10 |
if (!_from) return 0; |
118
|
2 |
8 |
if (*_from > date) return 1; |
119
|
8 |
0 |
if ((*_from + *this) < date) return -1; |
|
2 |
6 |
if ((*_from + *this) < date) return -1; |
159
|
31 |
0 |
inline DateRel operator+ (const DateRel& lhs, const DateRel& rhs) { return DateRel(lhs) += rhs; } |
|
31 |
0 |
inline DateRel operator+ (const DateRel& lhs, const DateRel& rhs) { return DateRel(lhs) += rhs; } |
160
|
12 |
0 |
inline DateRel operator- (const DateRel& lhs, const DateRel& rhs) { return DateRel(lhs) -= rhs; } |
|
12 |
0 |
inline DateRel operator- (const DateRel& lhs, const DateRel& rhs) { return DateRel(lhs) -= rhs; } |
161
|
33 |
0 |
inline DateRel operator* (const DateRel& dr, double koef) { return DateRel(dr) *= koef; } |
|
33 |
0 |
inline DateRel operator* (const DateRel& dr, double koef) { return DateRel(dr) *= koef; } |
163
|
17 |
0 |
inline DateRel operator/ (const DateRel& dr, double koef) { return DateRel(dr) /= koef; } |
|
17 |
0 |
inline DateRel operator/ (const DateRel& dr, double koef) { return DateRel(dr) /= koef; } |