{"id":18353617,"url":"https://github.com/taystack/get-date","last_synced_at":"2025-04-10T00:55:21.331Z","repository":{"id":57164688,"uuid":"338924588","full_name":"taystack/get-date","owner":"taystack","description":"Collection of native Date utilities to replace Moment.js","archived":false,"fork":false,"pushed_at":"2021-04-05T19:34:55.000Z","size":1329,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T00:55:16.656Z","etag":null,"topics":["date","daterange","datetime","datetimeformat","no-dependencies","timedelta","vanilla-javascript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taystack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-14T23:32:57.000Z","updated_at":"2023-03-04T03:23:58.000Z","dependencies_parsed_at":"2022-08-29T19:11:45.352Z","dependency_job_id":null,"html_url":"https://github.com/taystack/get-date","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fget-date","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fget-date/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fget-date/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fget-date/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taystack","download_url":"https://codeload.github.com/taystack/get-date/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137994,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","daterange","datetime","datetimeformat","no-dependencies","timedelta","vanilla-javascript"],"created_at":"2024-11-05T21:42:24.533Z","updated_at":"2025-04-10T00:55:21.310Z","avatar_url":"https://github.com/taystack.png","language":"TypeScript","readme":"# Javascript getDate\n[![codecov](https://codecov.io/gh/taystack/get-date/branch/master/graph/badge.svg?token=NU4F2FT8KN)](https://codecov.io/gh/taystack/get-date)\n![npm](https://img.shields.io/npm/v/@taystack/get-date?label=Latest%20version)\n\n### [Documentation](https://taystack.github.io/get-date)\n\n### [Play on Runkit](https://npm.runkit.com/%40taystack%2Fget-date)\n\n### Why?\n\n`Moment.js` has been retired. It had math operations on dates. I think Math is helpful on Dates.\n\n\u003e With `moment`\n```typescript\nimport moment from 'moment'\nconst now = Date.now()\nconst today = moment.utc(now)\nconst momentYesterday = today.subtract(1, 'days')\n```\n\n\u003e With `@taystack/getDate`:\n```typescript\nimport { getDate, subtractDays } from '@taystack/get-date' // es6\n// const { getDate, subtractDays } = require('@taystack/get-date') // es5\nconst now = Date.now()\nconst today = getDate(now)\nconst getDateYesterday = subtractDays(now, 1)\n```\n\n### What else?\n\nThere are no dependencies. This is a small set of helpers for working with native Javascript `Date` objects.\n\n# Installation\n```bash\nnpm i @taystack/get-date\n```\n\n# API\n\n  - [Getters](https://taystack.github.io/get-date/modules/getters.html)\n    - [getDate](https://taystack.github.io/get-date/modules/getters.html#getdate)\n    - [getDates](https://taystack.github.io/get-date/modules/getters.html#getdates)\n    - [getTime](https://taystack.github.io/get-date/modules/getters.html#getTime)\n    - [getDateInputValue](https://taystack.github.io/get-date/modules/getters.html#getdateinputvalue)\n    - [getStartOfDay](https://taystack.github.io/get-date/modules/getters.html#getstartofday)\n    - [getTimeString](https://taystack.github.io/get-date/modules/getters.html#gettimestring)\n  - [Equality](https://taystack.github.io/get-date/modules/equality.html)\n    - [eq](https://taystack.github.io/get-date/modules/equality.html#eq)\n    - [gt](https://taystack.github.io/get-date/modules/equality.html#gt)\n    - [gte](https://taystack.github.io/get-date/modules/equality.html#gte)\n    - [lt](https://taystack.github.io/get-date/modules/equality.html#lt)\n    - [lte](https://taystack.github.io/get-date/modules/equality.html#lte)\n  - [Math](https://taystack.github.io/get-date/modules/math.html)\n    - [addDays](https://taystack.github.io/get-date/modules/math.html#adddays)\n    - [addHours](https://taystack.github.io/get-date/modules/math.html#addhours)\n    - [addMilliseconds](https://taystack.github.io/get-date/modules/math.html#addmilliseconds)\n    - [addMinutes](https://taystack.github.io/get-date/modules/math.html#addminutes)\n    - [addSeconds](https://taystack.github.io/get-date/modules/math.html#addseconds)\n    - [addStep](https://taystack.github.io/get-date/modules/math.html#addstep)\n    - [subtractDays](https://taystack.github.io/get-date/modules/math.html#subtractdays)\n    - [subtractHours](https://taystack.github.io/get-date/modules/math.html#subtracthours)\n    - [subtractMilliseconds](https://taystack.github.io/get-date/modules/math.html#subtractmilliseconds)\n    - [subtractMinutes](https://taystack.github.io/get-date/modules/math.html#subtractminutes)\n    - [subtractSeconds](https://taystack.github.io/get-date/modules/math.html#subtractseconds)\n    - [subtractStep](https://taystack.github.io/get-date/modules/math.html#subtractstep)\n  - [Humanize](https://taystack.github.io/get-date/modules/humanize.html)\n    - [humanizeDay](https://taystack.github.io/get-date/modules/humanize.html#humanizeday)\n    - [humanizeDifference](https://taystack.github.io/get-date/modules/humanize.html#humanizeDifference)\n    - [humanizeMonth](https://taystack.github.io/get-date/modules/humanize.html#humanizemonth)\n    - [humanizeStep](https://taystack.github.io/get-date/modules/humanize.html#humanizestep)\n  - [TimeDelta](https://taystack.github.io/get-date/modules/timedelta.html)\n    - [difference](https://taystack.github.io/get-date/modules/timedelta.html#difference)\n    - [exclusiveRange](https://taystack.github.io/get-date/modules/timedelta.html#exclusiverange)\n    - [inclusiveRange](https://taystack.github.io/get-date/modules/timedelta.html#inclusiverange)\n    - [range](https://taystack.github.io/get-date/modules/timedelta.html#range)\n  - [helpers](https://taystack.github.io/get-date/modules/math.html)\n    - [leftPad](https://taystack.github.io/get-date/modules/math.html#leftpad)\n    - [pluralize](https://taystack.github.io/get-date/modules/math.html#pluralize)\n\n## Getters\n\n### getDate\n\n[getDate documentation](https://taystack.github.io/get-date/modules/getters.html#getdate)\n\n```typescript\nimport { getDate } from '@taystack/get-date'\ngetDate()\n// Same as new Date()\ngetDate(0)\n// new Date(0) -\u003e jan 1 1970\n```\n\n### getTime\n\n[getTime documentation](https://taystack.github.io/get-date/modules/getters.html#gettime)\n\n```typescript\nimport { getTime } from '@taystack/get-date'\ngetTime()\n// Same as Date.now()\ngetTime(0)\n// 0 -\u003e Short-hand new Date(0).getTime()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaystack%2Fget-date","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaystack%2Fget-date","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaystack%2Fget-date/lists"}