Skip to content

Commit

Permalink
get rid of moment dependency in vulcan utils
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Sep 28, 2022
1 parent 345ab21 commit 060ec1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 7 additions & 2 deletions packages/utils/date.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// import { forEachDocumentField } from "./schema_utils";
import moment from "moment";
export const getDateRange = function (pageNumber) {
/**
*
* @param moment An instance of "moment" => this avoids bundling moment in the package
* @param pageNumber
* @returns
*/
export const getDateRange = function (moment: any, pageNumber: number) {
var now = moment(new Date());
var dayToDisplay = now.subtract(pageNumber - 1, "days");
var range: any = {};
Expand Down
3 changes: 0 additions & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,5 @@
},
"optionalDependencies": {
"msw": "^0.35.0"
},
"peerDependencies": {
"moment": "^2.29.1"
}
}

1 comment on commit 060ec1e

@vercel
Copy link

@vercel vercel bot commented on 060ec1e Sep 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vulcan-docs – ./docusaurus

vulcan-docs-vulcan.vercel.app
vulcan-docs-git-main-vulcan.vercel.app
vulcan-docs.vercel.app

Please sign in to comment.