diff --git a/CHANGELOG.md b/CHANGELOG.md index ca7767e..f439d3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # deverything +## 0.51.0 + +### Minor Changes + +- startOfDay + ## 0.50.0 ### Minor Changes diff --git a/package.json b/package.json index 6894d99..3e1fba2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deverything", - "version": "0.50.0", + "version": "0.51.0", "description": "Everything you need for Dev", "main": "./dist/index.js", "module": "./dist/index.mjs", @@ -17,7 +17,7 @@ "lint": "TIMING=1 eslint src --fix", "prepublish": "pnpm test && pnpm build", "test": "jest", - "bump": "pnpm changeset && pnpm changeset version" + "release": "pnpm changeset && pnpm changeset version" }, "repository": { "type": "git", diff --git a/src/dates/index.ts b/src/dates/index.ts index 401ff3c..0655ab1 100644 --- a/src/dates/index.ts +++ b/src/dates/index.ts @@ -2,5 +2,6 @@ export * from "./isOver18"; export * from "./startOfNextMonth"; export * from "./startOfNextWeek"; export * from "./startOfThisWeek"; +export * from "./startOfDay"; export * from "./startOfToday"; export * from "./startOfTomorrow"; diff --git a/src/dates/startOfDay.ts b/src/dates/startOfDay.ts new file mode 100644 index 0000000..663db48 --- /dev/null +++ b/src/dates/startOfDay.ts @@ -0,0 +1,3 @@ +export const startOfDay = (day: Date): Date => { + return new Date(day.getFullYear(), day.getMonth(), day.getDate()); +}; diff --git a/src/dates/startOfToday.ts b/src/dates/startOfToday.ts index bc78965..5a43a03 100644 --- a/src/dates/startOfToday.ts +++ b/src/dates/startOfToday.ts @@ -1,4 +1,6 @@ -export const startOfToday = () => { +import { startOfDay } from "./startOfDay"; + +export const startOfToday = (): Date => { const now = new Date(); - return new Date(now.getFullYear(), now.getMonth(), now.getDate()); + return startOfDay(now); };