"d3-selection": "1.4.1",
"d3-shape": "1.3.7",
"d3-zoom": "1.8.3",
- "date-fns": "1.30.1",
+ "date-fns": "2.29.2",
"dompurify": "2.3.10",
"formik": "1.2.0",
"lodash": "4.17.21",
*/
import { differenceInMilliseconds, isAfter, isBefore } from 'date-fns';
import { cloneDeep, groupBy, sortBy } from 'lodash';
+import { parseDate } from '../../helpers/dates';
import { mockTask } from '../../helpers/mocks/tasks';
import { ActivityRequestParameters, Task, TaskStatuses, TaskTypes } from '../../types/tasks';
import {
(data.component && task.componentKey !== data.component) ||
(data.status && !data.status.split(',').includes(task.status)) ||
(data.type && task.type !== data.type) ||
- (data.minSubmittedAt && isBefore(task.submittedAt, data.minSubmittedAt)) ||
+ (data.minSubmittedAt &&
+ isBefore(parseDate(task.submittedAt), parseDate(data.minSubmittedAt))) ||
(data.maxExecutedAt &&
- (!task.executedAt || isAfter(task.executedAt, data.maxExecutedAt))) ||
+ (!task.executedAt ||
+ isAfter(parseDate(task.executedAt), parseDate(data.maxExecutedAt)))) ||
(data.q &&
!task.id.includes(data.q) &&
!task.componentName?.includes(data.q) &&
case TaskStatuses.Pending:
stats.pendingTime = Math.max(
stats.pendingTime,
- differenceInMilliseconds(task.submittedAt, Date.now())
+ differenceInMilliseconds(parseDate(task.submittedAt), Date.now())
);
stats.pending += 1;
break;
import CoverageRating from '../../../../components/ui/CoverageRating';
import DuplicationsRating from '../../../../components/ui/DuplicationsRating';
import Rating from '../../../../components/ui/Rating';
+import { parseDate } from '../../../../helpers/dates';
import { translate, translateWithParameters } from '../../../../helpers/l10n';
import { isDefined } from '../../../../helpers/types';
import { ComponentQualifier } from '../../../../types/component';
}
const newCodeTimespan = newCodeStartingDate
- ? differenceInMilliseconds(Date.now(), newCodeStartingDate)
+ ? differenceInMilliseconds(Date.now(), parseDate(newCodeStartingDate))
: 0;
const measureList = [
data-test="from"
highlightTo={this.to}
minDate={minDate}
- maxDate={maxDate && this.to ? min(maxDate, this.to) : maxDate || this.to}
+ maxDate={maxDate && this.to ? min([maxDate, this.to]) : maxDate || this.to}
onChange={this.handleFromChange}
placeholder={translate('start_date')}
value={this.from}
currentMonth={this.from}
data-test="to"
highlightFrom={this.from}
- minDate={minDate && this.from ? max(minDate, this.from) : minDate || this.from}
+ minDate={minDate && this.from ? max([minDate, this.from]) : minDate || this.from}
maxDate={maxDate}
onChange={this.handleToChange}
placeholder={translate('end_date')}
return <>{originalChildren(translate('never'))}</>;
}
- if (hourPrecision && differenceInHours(Date.now(), date) < 1) {
+ if (hourPrecision && differenceInHours(Date.now(), parseDate(date)) < 1) {
children = () => originalChildren(translate('less_than_1_hour_ago'));
}
differenceInYears
} from 'date-fns';
import { FormattedRelativeTime } from 'react-intl';
+import { parseDate } from '../../helpers/dates';
import { ParsableDate } from '../../types/dates';
const UPDATE_INTERVAL_IN_SECONDS = 10;
export function getRelativeTimeProps(
- date: ParsableDate
+ parsableDate: ParsableDate
): Pick<FormattedRelativeTime['props'], 'unit' | 'value' | 'updateIntervalInSeconds'> {
+ const date = parseDate(parsableDate);
const y = differenceInYears(date, Date.now());
if (Math.abs(y) > 0) {
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { parse } from 'date-fns';
import { ParsableDate } from '../types/dates';
function pad(number: number) {
}
export function parseDate(rawDate: ParsableDate): Date {
- return parse(rawDate);
+ return new Date(rawDate);
}
export function toShortNotSoISOString(rawDate: ParsableDate): string {
d3-selection: 1.4.1
d3-shape: 1.3.7
d3-zoom: 1.8.3
- date-fns: 1.30.1
+ date-fns: 2.29.2
dompurify: 2.3.10
enzyme: 3.11.0
enzyme-adapter-react-16: 1.15.6
languageName: node
linkType: hard
-"date-fns@npm:1.30.1":
- version: 1.30.1
- resolution: "date-fns@npm:1.30.1"
- checksum: 86b1f3269cbb1f3ee5ac9959775ea6600436f4ee2b78430cd427b41a0c9fabf740b1a5d401c085f3003539a6f4755c7c56c19fbd70ce11f6f673f6bc8075b710
+"date-fns@npm:2.29.2":
+ version: 2.29.2
+ resolution: "date-fns@npm:2.29.2"
+ checksum: 08bebcceb0a5dbadae4c55e6592b9d5c07dbd7833433c7e9a1d4a424300db32589b8b48e5979b32863c9b00a48d9bab6663e580c2a4f9f203d46cbf9113b5664
languageName: node
linkType: hard