{"id":15698668,"url":"https://github.com/arshadkazmi42/custom-date-formatting","last_synced_at":"2025-07-16T01:14:05.661Z","repository":{"id":49645287,"uuid":"101668065","full_name":"arshadkazmi42/custom-date-formatting","owner":"arshadkazmi42","description":":calendar: Npm package for custom date formatting ","archived":false,"fork":false,"pushed_at":"2021-08-15T08:54:33.000Z","size":1380,"stargazers_count":6,"open_issues_count":0,"forks_count":59,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-23T17:16:26.906Z","etag":null,"topics":["date-formatting","dates","format-date","formatting","moment"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arshadkazmi42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-28T17:17:48.000Z","updated_at":"2021-08-15T08:52:41.000Z","dependencies_parsed_at":"2022-09-17T02:31:18.017Z","dependency_job_id":null,"html_url":"https://github.com/arshadkazmi42/custom-date-formatting","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/arshadkazmi42/custom-date-formatting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcustom-date-formatting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcustom-date-formatting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcustom-date-formatting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcustom-date-formatting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arshadkazmi42","download_url":"https://codeload.github.com/arshadkazmi42/custom-date-formatting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arshadkazmi42%2Fcustom-date-formatting/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265473061,"owners_count":23772033,"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-formatting","dates","format-date","formatting","moment"],"created_at":"2024-10-03T19:31:55.323Z","updated_at":"2025-07-16T01:14:05.611Z","avatar_url":"https://github.com/arshadkazmi42.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Date Formatting\n[![Build Badge](https://api.travis-ci.org/arshadkazmi42/custom-date-formatting.svg?branch=master)](https://travis-ci.org/arshadkazmi42/custom-date-formatting)\n[![npm Downloads](https://img.shields.io/npm/dt/customdateformating.svg)](https://www.npmjs.com/package/customdateformating)\n[![Package Size](https://img.shields.io/bundlephobia/min/customdateformating.svg)](https://www.npmjs.com/package/customdateformating)\n[![NPM Version](https://img.shields.io/npm/v/customdateformating.svg)](https://www.npmjs.com/package/customdateformating)\n[![Contributors](https://img.shields.io/github/contributors/arshadkazmi42/custom-date-formatting.svg)](https://github.com/arshadkazmi42/custom-date-formatting/graphs/contributors)\n[![Commit](https://img.shields.io/github/last-commit/arshadkazmi42/custom-date-formatting.svg)](https://github.com/arshadkazmi42/custom-date-formatting/commits/master)\n\n## How to install?\n[![NPM](https://nodei.co/npm/customdateformating.png)](https://www.npmjs.com/package/customdateformating/)\n\n## Usage\n\n### Custom Format date with Days (+/-)\nPass the \u003cb\u003eformat\u003c/b\u003e of  the date required and \u003cb\u003enumberOfDays\u003c/b\u003e to add from current day to the Function.\u003cbr\u003e\nFor previous days \u003cb\u003enumberOfDays\u003c/b\u003e should be passed as negative value.\u003cbr\u003e\n```javascript\n// Create Instance of the DateValidator\nconst DateFormatting = require('custom-date-formatting');\n\n// This will return a string with new date\nDateFormatting.getNextOrPrevDateCustomFormat(\"YYYY-MM-DD\", 0);\n\n// Output: \"2018-10-06\"\n\n```\n\n### Custom Format date with Minutes (+/-)\nPass the \u003cb\u003eformat\u003c/b\u003e of date required and \u003cb\u003eminutesToAdd\u003c/b\u003e to add/subtract minutes from current time to the Function.\u003cbr\u003e For passed minute of time, \u003cb\u003eminutesToAdd\u003c/b\u003e should be passed as negative value.\u003cbr\u003e\n```javascript\n// Create Instance of the DateValidator\nconst DateFormatting = require('custom-date-formatting');\n\n// This will return a string with new date and time\nDateFormatting.getNextOrPrevMinuteDateCustomFormat(\"YYYY-MM-DD HH:mm\", 1);\n\n// Output: \"2018-10-06 00:39\"\n```\n\n### Custom Format date with Seconds (+/-)\nPass the \u003cb\u003eformat\u003c/b\u003e of date required and \u003cb\u003esecondsToAdd\u003c/b\u003e to add/subtract seconds from current time.\u003cbr\u003eFor passed minute of time, \u003cb\u003esecondsToAdd\u003c/b\u003e should be passed as negative value.\u003cbr\u003e\n```javascript\n// Create Instance of the DateValidator\nconst DateFormatting = require('custom-date-formatting');\n// This will return a string with new date and time\nDateFormatting.getNextOrPrevSecondDateCustomFormat(\"YYYY-MM-DD HH:mm:ss\", 10);\n\n// Output: \"2018-10-06 00:40:02\"\n```\n\n### Custom Source Format date custom new format\nPass the \u003cb\u003edate\u003c/b\u003e (input date), \u003cb\u003ecurrentFormat\u003c/b\u003e (input date format), \u003cb\u003enewformat\u003c/b\u003e. (required date format)to the Function.\u003cbr\u003e\n```javascript\n// Create Instance of the DateValidator\nconst DateFormatting = require('custom-date-formatting');\n\n// This will return a string with date in new format\nDateFormatting.customSourceDateFormatToCustomNewDateFormat(\"2017-08-28 23:22:00\", \"YYYY-MM-DD HH:mm:ss\", \"dddd DD MMM YYYY\");\n\n// Output: \"Monday 28 Aug 2017\"\n```\n\n### Timestamp from custom date format\nPass the \u003cb\u003edate\u003c/b\u003e (input date), \u003cb\u003ecurrentFormat\u003c/b\u003e (input date format)to the function.\u003cbr\u003e\n```javascript\n// Create Instance of the DateValidator\nconst DateFormatting = require('customdateformatting');\n\n// This will return input date value as timestamp in milliseconds.\nDateFormatting.getTimeStampFromCurrentDateFormat(\"28 Aug 2017\", \"DD MMM YYYY\");\n\n// Output: 1503858600000\n```\n\n## Contributors\n\nThank you to all the contributors who have helped us in making this project better 🙌\n\n\u003ca href=\"https://github.com/arshadkazmi42\"\u003e\u003cimg src=\"https://github.com/arshadkazmi42.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/rogers9798\"\u003e\u003cimg src=\"https://github.com/rogers9798.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/msarfrazanwar\"\u003e\u003cimg src=\"https://github.com/msarfrazanwar.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/alexdresko\"\u003e\u003cimg src=\"https://github.com/alexdresko.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/alvintan05\"\u003e\u003cimg src=\"https://github.com/alvintan05.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/mayankDhiman\"\u003e\u003cimg src=\"https://github.com/mayankDhiman.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/albanmahmut\"\u003e\u003cimg src=\"https://github.com/albanmahmut.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/momomen\"\u003e\u003cimg src=\"https://github.com/momomen.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/adrianteri\"\u003e\u003cimg src=\"https://github.com/adrianteri.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/Apoorva-13\"\u003e\u003cimg src=\"https://github.com/Apoorva-13.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/nine-tails9\"\u003e\u003cimg src=\"https://github.com/nine-tails9.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/piyushchauhan\"\u003e\u003cimg src=\"https://github.com/piyushchauhan.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/roshanadh\"\u003e\u003cimg src=\"https://github.com/roshanadh.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/sauravjaiswalsj\"\u003e\u003cimg src=\"https://github.com/sauravjaiswalsj.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/chong601\"\u003e\u003cimg src=\"https://github.com/chong601.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/dependabot[bot]\"\u003e\u003cimg src=\"https://github.com/dependabot[bot].png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/hyp3rflux\"\u003e\u003cimg src=\"https://github.com/hyp3rflux.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/shubhankarb180\"\u003e\u003cimg src=\"https://github.com/shubhankarb180.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/siddhartthecoder\"\u003e\u003cimg src=\"https://github.com/siddhartthecoder.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/kindacoder\"\u003e\u003cimg src=\"https://github.com/kindacoder.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/ael-mas\"\u003e\u003cimg src=\"https://github.com/ael-mas.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/agarwal-akash\"\u003e\u003cimg src=\"https://github.com/agarwal-akash.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/AlphaLazer\"\u003e\u003cimg src=\"https://github.com/AlphaLazer.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/anniann\"\u003e\u003cimg src=\"https://github.com/anniann.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/arkwrn\"\u003e\u003cimg src=\"https://github.com/arkwrn.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/dillbala\"\u003e\u003cimg src=\"https://github.com/dillbala.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/bibekluitel\"\u003e\u003cimg src=\"https://github.com/bibekluitel.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/BolajiAyodeji\"\u003e\u003cimg src=\"https://github.com/BolajiAyodeji.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/chrisgalvan\"\u003e\u003cimg src=\"https://github.com/chrisgalvan.png\" width=\"30\" /\u003e\u003c/a\u003e\u003ca href=\"https://github.com/StudentDawid\"\u003e\u003cimg src=\"https://github.com/StudentDawid.png\" width=\"30\" /\u003e\u003c/a\u003e\n\n## Contributing Guidelines\nRead the contributing guidelines [here](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farshadkazmi42%2Fcustom-date-formatting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farshadkazmi42%2Fcustom-date-formatting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farshadkazmi42%2Fcustom-date-formatting/lists"}