Merge pull request #14183 from namco1992/cleanup-momentjs

Cleanup the momentjs dependency in plugin-github-pull-requests-board
This commit is contained in:
Fredrik Adelöw
2022-10-18 10:39:52 +01:00
committed by GitHub
4 changed files with 9 additions and 4 deletions
@@ -44,7 +44,7 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "4.0.0-alpha.57",
"@octokit/rest": "^19.0.3",
"moment": "^2.29.1",
"luxon": "^3.0.0",
"react-use": "^17.2.4"
},
"devDependencies": {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { Entity } from '@backstage/catalog-model';
import moment from 'moment';
import { DateTime } from 'luxon';
import {
Reviews,
PullRequests,
@@ -58,7 +58,7 @@ export const filterSameUser = (users: Author[]): Author[] => {
};
export const getElapsedTime = (start: string): string => {
return moment(start).fromNow();
return DateTime.fromISO(start).toRelative() ?? start;
};
export const formatPRsByReviewDecision = (