Skip to content

Commit

Permalink
Migrate to date and time utils from frontend-shared (#6742)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya authored Oct 2, 2024
1 parent 825e3c8 commit ac976d7
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
FilterClearIcon,
LinkButton,
MultiSelect,
formatDateTime,
} from '@hypothesis/frontend-shared';
import classnames from 'classnames';
import type { MutableRef } from 'preact/hooks';
Expand All @@ -19,7 +20,6 @@ import type {
} from '../../api-types';
import { useConfig } from '../../config';
import { usePaginatedAPIFetch } from '../../utils/api';
import { formatDateTime } from '../../utils/date';
import PaginatedMultiSelect from './PaginatedMultiSelect';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { formatDateTime } from '@hypothesis/frontend-shared';
import { useMemo } from 'preact/hooks';

import { formatDateTime } from '../../utils/date';

export type FormattedDateProps = {
/** Date in ISO format */
date: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { formatDateTime } from '@hypothesis/frontend-shared';
import {
checkAccessibility,
mockImportedComponents,
Expand All @@ -7,7 +8,6 @@ import { act } from 'preact/test-utils';
import sinon from 'sinon';

import { Config } from '../../../config';
import { formatDateTime } from '../../../utils/date';
import AllCoursesActivity, { $imports } from '../AllCoursesActivity';

describe('AllCoursesActivity', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { formatDateTime } from '@hypothesis/frontend-shared';
import {
checkAccessibility,
mockImportedComponents,
Expand All @@ -7,7 +8,6 @@ import { act } from 'preact/test-utils';
import sinon from 'sinon';

import { Config } from '../../../config';
import { formatDateTime } from '../../../utils/date';
import AssignmentActivity, { $imports } from '../AssignmentActivity';

describe('AssignmentActivity', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MultiSelect } from '@hypothesis/frontend-shared';
import { formatDateTime } from '@hypothesis/frontend-shared';
import {
checkAccessibility,
mockImportedComponents,
Expand All @@ -7,7 +8,6 @@ import { mount } from 'enzyme';
import sinon from 'sinon';

import { Config } from '../../../config';
import { formatDateTime } from '../../../utils/date';
import DashboardActivityFilters, {
$imports,
} from '../DashboardActivityFilters';
Expand Down
60 changes: 0 additions & 60 deletions lms/static/scripts/frontend_apps/utils/date.ts

This file was deleted.

46 changes: 0 additions & 46 deletions lms/static/scripts/frontend_apps/utils/test/date-test.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@hypothesis/frontend-build": "^3.0.0",
"@hypothesis/frontend-shared": "^8.5.0",
"@hypothesis/frontend-shared": "^8.7.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^28.0.0",
"@rollup/plugin-node-resolve": "^15.3.0",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2169,15 +2169,15 @@ __metadata:
languageName: node
linkType: hard

"@hypothesis/frontend-shared@npm:^8.5.0":
version: 8.5.0
resolution: "@hypothesis/frontend-shared@npm:8.5.0"
"@hypothesis/frontend-shared@npm:^8.7.0":
version: 8.7.0
resolution: "@hypothesis/frontend-shared@npm:8.7.0"
dependencies:
highlight.js: ^11.6.0
wouter-preact: ^3.0.0
peerDependencies:
preact: ^10.4.0
checksum: 4d01b2f07dc44173351e3e72f9607b54596468d620a0f872fe851776ad5c77dce5ec631fdfe77654c6851f9a24a3701a5bbf0df78bf4ceff580ace73a86bd91a
checksum: 646087a5d592080e7bdd336ecd18df047450b15c3410b4bd39b36a41702bfcdbbf39b378ad3a17a2442b825dfc0500d10c25be24b6c2a9d814052f33d3e2fe11
languageName: node
linkType: hard

Expand Down Expand Up @@ -7412,7 +7412,7 @@ __metadata:
"@babel/preset-react": ^7.24.7
"@babel/preset-typescript": ^7.24.7
"@hypothesis/frontend-build": ^3.0.0
"@hypothesis/frontend-shared": ^8.5.0
"@hypothesis/frontend-shared": ^8.7.0
"@hypothesis/frontend-testing": ^1.2.2
"@rollup/plugin-babel": ^6.0.4
"@rollup/plugin-commonjs": ^28.0.0
Expand Down

0 comments on commit ac976d7

Please sign in to comment.